obj.setCreated(resource.getLastModified()); obj.setBlobSize((int) resource.getSize());
@Override public boolean get(TileObject obj) throws StorageException { final String key = keyBuilder.forTile(obj); final S3Object object = s3Ops.getObject(key); if (object == null) { return false; } try (S3ObjectInputStream in = object.getObjectContent()) { byte[] bytes = ByteStreams.toByteArray(in); obj.setBlobSize(bytes.length); obj.setBlob(new ByteArrayResource(bytes)); obj.setCreated(object.getObjectMetadata().getLastModified().getTime()); } catch (IOException e) { throw new StorageException("Error getting " + key, e); } return true; }
@Override public boolean get(TileObject obj) throws StorageException { final String key = keyBuilder.forTile(obj); final S3Object object = s3Ops.getObject(key); if (object == null) { return false; } try (S3ObjectInputStream in = object.getObjectContent()) { byte[] bytes = ByteStreams.toByteArray(in); obj.setBlobSize(bytes.length); obj.setBlob(new ByteArrayResource(bytes)); obj.setCreated(object.getObjectMetadata().getLastModified().getTime()); } catch (IOException e) { throw new StorageException("Error getting " + key, e); } return true; }
@Override public boolean get(TileObject stObj) throws StorageException { stObj.setBlob(new FileResource(imageTile)); stObj.setCreated((new Date()).getTime()); stObj.setBlobSize(1000); return true; } });
/** * Set the blob property of a TileObject. * * @param stObj the tile to load. Its setBlob() method will be called. * @return true if successful, false otherwise */ public boolean get(TileObject stObj) throws StorageException { File fh = getFileHandleTile(stObj, false); if (!fh.exists()) { stObj.setStatus(Status.MISS); return false; } else { Resource resource = readFile(fh); stObj.setBlob(resource); stObj.setCreated(resource.getLastModified()); stObj.setBlobSize((int) resource.getSize()); return true; } }
file, tile.getXYZ()[2], tile.getXYZ()[0], tile.getXYZ()[1], createdTime); tile.setCreated(createdTime); } else if (exists) { tile.setCreated(System.currentTimeMillis());
file, tile.getXYZ()[2], tile.getXYZ()[0], tile.getXYZ()[1], createdTime); tile.setCreated(createdTime); } else if (exists) { tile.setCreated(System.currentTimeMillis());
new File(getClass().getResource("/image.png").toURI()); stObj.setBlob(new FileResource(imageTile)); stObj.setCreated((new Date()).getTime()); stObj.setBlobSize(1000); return true;
tileProto.getParameters(), resource); tile.setCreated(requestTime); tileProto.getStorageBroker().put(tile); tileProto.getStorageObject().setCreated(tile.getCreated()); } catch (StorageException e) { throw new GeoWebCacheException(e);