@Test(expected = InvalidSizeException.class) public void testGetContentFromS3WhenSizeIsInvalid() throws Exception { ContentRetrievalContext context = new ContentRetrievalContext(1, 1, 1); context.setS3Client(s3Client); when(s3Client.getObject(argThat(new GetObjectArgumentMatcher()))).thenReturn(s3Object); when(s3Object.getObjectMetadata()).thenReturn(s3ObjectMeta); when(s3ObjectMeta.getContentLength()).thenReturn(Long.valueOf(-1)); ObjectStoreContentProviderUtils.getContentFromURL(s3ResourceLoc, context); }
public static byte[] getContentFromURL(String resourceLoc, ContentRetrievalContext context) throws IOException, InvalidSizeException, S3EndpointNotFoundException { if (resourceLoc.startsWith(S3_URL_PREFIX)) { return getContentFromS3(resourceLoc, context); } else { return getContentFromURL(new URL(resourceLoc), context); } }
ObjectStoreContentProviderUtils { public static byte[] getContentFromURL(String resourceLoc, ContentRetrievalContext context) throws IOException, InvalidSizeException, S3EndpointNotFoundException { if (resourceLoc.startsWith(S3_URL_PREFIX)) { return getContentFromS3(resourceLoc, context); } else { return getContentFromURL(new URL(resourceLoc), context); } } }
ObjectStoreContentProviderUtils { public static byte[] getContentFromURL(String resourceLoc, ContentRetrievalContext context) throws IOException, InvalidSizeException, S3EndpointNotFoundException { if (resourceLoc.startsWith(S3_URL_PREFIX)) { return getContentFromS3(resourceLoc, context); } else { return getContentFromURL(new URL(resourceLoc), context); } } private  ObjectStoreContentProviderUtils(); }
ObjectStoreContentProviderUtils { public static byte[] getContentFromURL(String resourceLoc, ContentRetrievalContext context) throws IOException, InvalidSizeException, S3EndpointNotFoundException { if (resourceLoc.startsWith(S3_URL_PREFIX)) { return getContentFromS3(resourceLoc, context); } else { return getContentFromURL(new URL(resourceLoc), context); } } private  ObjectStoreContentProviderUtils(); static byte[] getContentFromURL(String resourceLoc,
			ContentRetrievalContext context); static byte[] getContentFromURL(URL url,
            ContentRetrievalContext context); static String generateObjectId(String resultId, String url,
			String defaultEncoding, String digestAlgorithm); static String extractResultIdFromObjectId(String objectId); }
ObjectStoreContentProviderUtils { public static byte[] getContentFromURL(String resourceLoc, ContentRetrievalContext context) throws IOException, InvalidSizeException, S3EndpointNotFoundException { if (resourceLoc.startsWith(S3_URL_PREFIX)) { return getContentFromS3(resourceLoc, context); } else { return getContentFromURL(new URL(resourceLoc), context); } } private  ObjectStoreContentProviderUtils(); static byte[] getContentFromURL(String resourceLoc,
			ContentRetrievalContext context); static byte[] getContentFromURL(URL url,
            ContentRetrievalContext context); static String generateObjectId(String resultId, String url,
			String defaultEncoding, String digestAlgorithm); static String extractResultIdFromObjectId(String objectId); static final String defaultEncoding; }