@Test public void getDataExceptionOnDir() throws IOException { FilesystemAsset asset = new FilesystemAsset(filesystemStorage, "/test1234", assetPathDir); Files.write(assetPathFile, "abcdef".getBytes("ASCII")); try { InputStream is = asset.getReadStream(); Assert.assertFalse("Exception expected for data on dir", true); } catch (IOException e) { } }
@Override public InputStream getReadStream() throws IOException { if (isContainer()) { throw new IOException("Can not create input stream for container"); } return Files.newInputStream(assetPath); }
FilesystemAsset implements StorageAsset, Comparable { @Override public InputStream getReadStream() throws IOException { if (isContainer()) { throw new IOException("Can not create input stream for container"); } return Files.newInputStream(assetPath); } }
FilesystemAsset implements StorageAsset, Comparable { @Override public InputStream getReadStream() throws IOException { if (isContainer()) { throw new IOException("Can not create input stream for container"); } return Files.newInputStream(assetPath); } FilesystemAsset(RepositoryStorage storage, String path, Path assetPath, Path basePath);  FilesystemAsset(RepositoryStorage storage, String path, Path assetPath);  FilesystemAsset(RepositoryStorage storage, String path, Path assetPath, Path basePath, boolean directory);  FilesystemAsset(RepositoryStorage storage, String path, Path assetPath, Path basePath, boolean directory, boolean setPermissionsForNew); }
FilesystemAsset implements StorageAsset, Comparable { @Override public InputStream getReadStream() throws IOException { if (isContainer()) { throw new IOException("Can not create input stream for container"); } return Files.newInputStream(assetPath); } FilesystemAsset(RepositoryStorage storage, String path, Path assetPath, Path basePath);  FilesystemAsset(RepositoryStorage storage, String path, Path assetPath);  FilesystemAsset(RepositoryStorage storage, String path, Path assetPath, Path basePath, boolean directory);  FilesystemAsset(RepositoryStorage storage, String path, Path assetPath, Path basePath, boolean directory, boolean setPermissionsForNew); @Override RepositoryStorage getStorage( ); @Override String getPath(); @Override String getName(); @Override Instant getModificationTime(); @Override boolean isContainer(); @Override boolean isLeaf( ); @Override List<StorageAsset> list(); @Override long getSize(); @Override InputStream getReadStream(); @Override ReadableByteChannel getReadChannel( ); @Override OutputStream getWriteStream( boolean replace); @Override WritableByteChannel getWriteChannel( boolean replace ); @Override boolean replaceDataFromFile( Path newData); @Override boolean exists(); @Override Path getFilePath(); @Override boolean isFileBased( ); @Override boolean hasParent( ); @Override StorageAsset getParent( ); @Override StorageAsset resolve(String toPath); void setDefaultFileAcls(List<AclEntry> acl); List<AclEntry> getDefaultFileAcls(); void setDefaultPosixFilePermissions(Set<PosixFilePermission> perms); Set<PosixFilePermission> getDefaultPosixFilePermissions(); void setDefaultDirectoryAcls(List<AclEntry> acl); List<AclEntry> getDefaultDirectoryAcls(); void setDefaultPosixDirectoryPermissions(Set<PosixFilePermission> perms); Set<PosixFilePermission> getDefaultPosixDirectoryPermissions(); @Override void create(); @Override String toString(); @Override int compareTo(Object o); @Override boolean equals( Object o ); @Override int hashCode( ); }
FilesystemAsset implements StorageAsset, Comparable { @Override public InputStream getReadStream() throws IOException { if (isContainer()) { throw new IOException("Can not create input stream for container"); } return Files.newInputStream(assetPath); } FilesystemAsset(RepositoryStorage storage, String path, Path assetPath, Path basePath);  FilesystemAsset(RepositoryStorage storage, String path, Path assetPath);  FilesystemAsset(RepositoryStorage storage, String path, Path assetPath, Path basePath, boolean directory);  FilesystemAsset(RepositoryStorage storage, String path, Path assetPath, Path basePath, boolean directory, boolean setPermissionsForNew); @Override RepositoryStorage getStorage( ); @Override String getPath(); @Override String getName(); @Override Instant getModificationTime(); @Override boolean isContainer(); @Override boolean isLeaf( ); @Override List<StorageAsset> list(); @Override long getSize(); @Override InputStream getReadStream(); @Override ReadableByteChannel getReadChannel( ); @Override OutputStream getWriteStream( boolean replace); @Override WritableByteChannel getWriteChannel( boolean replace ); @Override boolean replaceDataFromFile( Path newData); @Override boolean exists(); @Override Path getFilePath(); @Override boolean isFileBased( ); @Override boolean hasParent( ); @Override StorageAsset getParent( ); @Override StorageAsset resolve(String toPath); void setDefaultFileAcls(List<AclEntry> acl); List<AclEntry> getDefaultFileAcls(); void setDefaultPosixFilePermissions(Set<PosixFilePermission> perms); Set<PosixFilePermission> getDefaultPosixFilePermissions(); void setDefaultDirectoryAcls(List<AclEntry> acl); List<AclEntry> getDefaultDirectoryAcls(); void setDefaultPosixDirectoryPermissions(Set<PosixFilePermission> perms); Set<PosixFilePermission> getDefaultPosixDirectoryPermissions(); @Override void create(); @Override String toString(); @Override int compareTo(Object o); @Override boolean equals( Object o ); @Override int hashCode( ); static final String DEFAULT_POSIX_FILE_PERMS; static final String DEFAULT_POSIX_DIR_PERMS; static final Set<PosixFilePermission> DEFAULT_POSIX_FILE_PERMISSIONS; static final Set<PosixFilePermission> DEFAULT_POSIX_DIR_PERMISSIONS; static final AclEntryPermission[] DEFAULT_ACL_FILE_PERMISSIONS; static final AclEntryPermission[] DEFAULT_ACL_DIR_PERMISSIONS; }