CompositeBlobStore.checkSuitability(rootPath, exists, empty);
CompositeBlobStore.checkSuitability(configuration.getRootDirectory(), exists, empty);
CompositeBlobStore.checkSuitability(configuration.getRootDirectory(), exists, empty);
public S3BlobStore( S3BlobStoreInfo config, TileLayerDispatcher layers, LockProvider lockProvider) throws StorageException { checkNotNull(config); checkNotNull(layers); this.bucketName = config.getBucket(); String prefix = config.getPrefix() == null ? "" : config.getPrefix(); this.keyBuilder = new TMSKeyBuilder(prefix, layers); conn = config.buildClient(); acl = config.getAccessControlList(); try { log.debug("Checking policy for bucket " + bucketName); BucketPolicy bucketPol = this.conn.getBucketPolicy(bucketName); log.debug("Bucket " + bucketName + " policy: " + bucketPol.getPolicyText()); } catch (AmazonServiceException se) { throw new StorageException( "Server error getting bucket policy: " + se.getMessage(), se); } catch (AmazonClientException ce) { throw new StorageException("Unable to connect to AWS S3", ce); } this.s3Ops = new S3Ops(conn, bucketName, keyBuilder, lockProvider); boolean empty = !s3Ops.prefixExists(prefix); boolean existing = Objects.nonNull(s3Ops.getObjectMetadata(keyBuilder.storeMetadata())); CompositeBlobStore.checkSuitability(config.getLocation(), existing, empty); // TODO replace this with real metadata. For now it's just a marker // to indicate this is a GWC cache. s3Ops.putProperties(keyBuilder.storeMetadata(), new Properties()); }
public S3BlobStore( S3BlobStoreInfo config, TileLayerDispatcher layers, LockProvider lockProvider) throws StorageException { checkNotNull(config); checkNotNull(layers); this.bucketName = config.getBucket(); String prefix = config.getPrefix() == null ? "" : config.getPrefix(); this.keyBuilder = new TMSKeyBuilder(prefix, layers); conn = config.buildClient(); acl = config.getAccessControlList(); try { log.debug("Checking policy for bucket " + bucketName); BucketPolicy bucketPol = this.conn.getBucketPolicy(bucketName); log.debug("Bucket " + bucketName + " policy: " + bucketPol.getPolicyText()); } catch (AmazonServiceException se) { throw new StorageException( "Server error getting bucket policy: " + se.getMessage(), se); } catch (AmazonClientException ce) { throw new StorageException("Unable to connect to AWS S3", ce); } this.s3Ops = new S3Ops(conn, bucketName, keyBuilder, lockProvider); boolean empty = !s3Ops.prefixExists(prefix); boolean existing = Objects.nonNull(s3Ops.getObjectMetadata(keyBuilder.storeMetadata())); CompositeBlobStore.checkSuitability(config.getLocation(), existing, empty); // TODO replace this with real metadata. For now it's just a marker // to indicate this is a GWC cache. s3Ops.putProperties(keyBuilder.storeMetadata(), new Properties()); }