FileBlobStore extends BlobStoreSupport<FileAttributesLocation> { @Override @Guarded(by = STARTED) public Blob create(final Path sourceFile, final Map<String, String> headers, final long size, final HashCode sha1) { checkNotNull(sourceFile); checkNotNull(sha1); checkArgument(Files.exists(sourceFile)); return create(headers, destination -> { fileOperations.hardLink(sourceFile, destination); return new StreamMetrics(size, sha1.toString()); }, null); } @Inject  FileBlobStore(final BlobIdLocationResolver blobIdLocationResolver,
                       final FileOperations fileOperations,
                       final ApplicationDirectories applicationDirectories,
                       final FileBlobStoreMetricsStore metricsStore,
                       final NodeAccess nodeAccess,
                       final DryRunPrefix dryRunPrefix); @VisibleForTesting  FileBlobStore(final Path contentDir, //NOSONAR
                       final BlobIdLocationResolver blobIdLocationResolver,
                       final FileOperations fileOperations,
                       final FileBlobStoreMetricsStore metricsStore,
                       final BlobStoreConfiguration configuration,
                       final ApplicationDirectories directories,
                       final NodeAccess nodeAccess,
                       final DryRunPrefix dryRunPrefix); @Override @Guarded(by = STARTED) Blob create(final Path sourceFile, final Map<String, String> headers, final long size, final HashCode sha1); @Override @Guarded(by = STARTED) @Timed Blob copy(final BlobId blobId, final Map<String, String> headers); @Nullable @Override @Guarded(by = STARTED) Blob get(final BlobId blobId); @Nullable @Override @Guarded(by = STARTED) @Timed Blob get(final BlobId blobId, final boolean includeDeleted); @Override @Guarded(by = STARTED) BlobStoreMetrics getMetrics(); @Override boolean isStorageAvailable(); @Override boolean exists(final BlobId blobId); @Override @Guarded(by = {NEW, STOPPED, FAILED, SHUTDOWN}) void remove(); @Override Stream<BlobId> getBlobIdStream(); @Override Stream<BlobId> getDirectPathBlobIdStream(final String prefix); @VisibleForTesting Path getContentDir(); @Nullable @Override BlobAttributes getBlobAttributes(final BlobId blobId); @Override BlobAttributes getBlobAttributes(final FileAttributesLocation attributesFilePath); @Override void setBlobAttributes(BlobId blobId, BlobAttributes blobAttributes); static final String BASEDIR; static final String TYPE; static final String BLOB_CONTENT_SUFFIX; @VisibleForTesting
  static final String CONFIG_KEY; @VisibleForTesting
  static final String PATH_KEY; @VisibleForTesting
  static final String METADATA_FILENAME; @VisibleForTesting
  static final String TYPE_KEY; @VisibleForTesting
  static final String TYPE_V1; @VisibleForTesting
  static final String REBUILD_DELETED_BLOB_INDEX_KEY; @VisibleForTesting
  static final String DELETIONS_FILENAME; }
@Test(expected = BlobStoreException.class) public void impossibleHardLinkThrowsBlobStoreException() throws Exception { Path path = util.createTempFile().toPath(); doThrow(new FileSystemException(null)).when(fileOperations).hardLink(any(), any()); underTest.create(path, TEST_HEADERS, 0, HashCode.fromString("da39a3ee5e6b4b0d3255bfef95601890afd80709")); }