@Test(expected = ArtifactNotFoundException.class) public void shouldRaiseExceptionWhenArtifactNotFound() throws Exception { when(fileStoreJpaRepository.findByFileStoreIdAndTenantId("fileStoreId", TENANT_ID)).thenReturn(null); artifactRepository.find("fileStoreId", TENANT_ID); }
public Resource find(String fileStoreId, String tenantId) throws IOException { Artifact artifact = fileStoreJpaRepository.findByFileStoreIdAndTenantId(fileStoreId, tenantId); if (artifact == null) throw new ArtifactNotFoundException(fileStoreId); org.springframework.core.io.Resource resource = diskFileStoreRepository.read(artifact.getFileLocation()); return new Resource(artifact.getContentType(), artifact.getFileName(), resource, artifact.getTenantId(),""+resource.getFile().length()+" bytes"); }
ArtifactRepository { public Resource find(String fileStoreId, String tenantId) throws IOException { Artifact artifact = fileStoreJpaRepository.findByFileStoreIdAndTenantId(fileStoreId, tenantId); if (artifact == null) throw new ArtifactNotFoundException(fileStoreId); org.springframework.core.io.Resource resource = diskFileStoreRepository.read(artifact.getFileLocation()); return new Resource(artifact.getContentType(), artifact.getFileName(), resource, artifact.getTenantId(),""+resource.getFile().length()+" bytes"); } }
ArtifactRepository { public Resource find(String fileStoreId, String tenantId) throws IOException { Artifact artifact = fileStoreJpaRepository.findByFileStoreIdAndTenantId(fileStoreId, tenantId); if (artifact == null) throw new ArtifactNotFoundException(fileStoreId); org.springframework.core.io.Resource resource = diskFileStoreRepository.read(artifact.getFileLocation()); return new Resource(artifact.getContentType(), artifact.getFileName(), resource, artifact.getTenantId(),""+resource.getFile().length()+" bytes"); } ArtifactRepository(DiskFileStoreRepository diskFileStoreRepository,
			FileStoreJpaRepository fileStoreJpaRepository); }
ArtifactRepository { public Resource find(String fileStoreId, String tenantId) throws IOException { Artifact artifact = fileStoreJpaRepository.findByFileStoreIdAndTenantId(fileStoreId, tenantId); if (artifact == null) throw new ArtifactNotFoundException(fileStoreId); org.springframework.core.io.Resource resource = diskFileStoreRepository.read(artifact.getFileLocation()); return new Resource(artifact.getContentType(), artifact.getFileName(), resource, artifact.getTenantId(),""+resource.getFile().length()+" bytes"); } ArtifactRepository(DiskFileStoreRepository diskFileStoreRepository,
			FileStoreJpaRepository fileStoreJpaRepository); List<String> save(List<org.egov.filestore.domain.model.Artifact> artifacts); Resource find(String fileStoreId, String tenantId); List<FileInfo> findByTag(String tag, String tenantId); List<Artifact> getByTenantIdAndFileStoreIdList(String tenantId, List<String> fileStoreIds); }
ArtifactRepository { public Resource find(String fileStoreId, String tenantId) throws IOException { Artifact artifact = fileStoreJpaRepository.findByFileStoreIdAndTenantId(fileStoreId, tenantId); if (artifact == null) throw new ArtifactNotFoundException(fileStoreId); org.springframework.core.io.Resource resource = diskFileStoreRepository.read(artifact.getFileLocation()); return new Resource(artifact.getContentType(), artifact.getFileName(), resource, artifact.getTenantId(),""+resource.getFile().length()+" bytes"); } ArtifactRepository(DiskFileStoreRepository diskFileStoreRepository,
			FileStoreJpaRepository fileStoreJpaRepository); List<String> save(List<org.egov.filestore.domain.model.Artifact> artifacts); Resource find(String fileStoreId, String tenantId); List<FileInfo> findByTag(String tag, String tenantId); List<Artifact> getByTenantIdAndFileStoreIdList(String tenantId, List<String> fileStoreIds);  }