public abstract class AbstractIOService extends Object implements IOServiceIdentifiable, IOServiceLockable
IOService.NewFileSystemListener| Modifier and Type | Field and Description |
|---|---|
protected static String |
DEFAULT_SERVICE_NAME |
protected Set<FileSystem> |
fileSystems |
protected IOWatchService |
ioWatchService |
protected boolean |
isDisposed |
protected IOService.NewFileSystemListener |
newFileSystemListener |
protected static Charset |
UTF_8 |
EMPTY_OPTIONS| Constructor and Description |
|---|
AbstractIOService() |
AbstractIOService(IOWatchService watchService) |
AbstractIOService(String id) |
AbstractIOService(String id,
IOWatchService watchService) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcopy, createDirectories, createDirectory, delete, deleteIfExists, getAttribute, getFileAttributeView, move, newByteChannel, readAttributes, setAttributesprotected static final String DEFAULT_SERVICE_NAME
protected static final Charset UTF_8
protected final IOWatchService ioWatchService
protected final Set<FileSystem> fileSystems
protected IOService.NewFileSystemListener newFileSystemListener
protected boolean isDisposed
public AbstractIOService()
public AbstractIOService(String id)
public AbstractIOService(IOWatchService watchService)
public AbstractIOService(String id, IOWatchService watchService)
public void startBatch(FileSystem fs)
startBatch in interface IOServicepublic void startBatch(FileSystem fs, Option... options)
startBatch in interface IOServicepublic void startBatch(FileSystem... fs)
startBatch in interface IOServicepublic void startBatch(FileSystem[] fs, Option... options)
startBatch in interface IOServicepublic BatchLockControl getLockControl()
getLockControl in interface IOServiceLockablepublic Path get(String first, String... more) throws IllegalArgumentException
get in interface IOServiceIllegalArgumentExceptionpublic Path get(URI uri) throws IllegalArgumentException, FileSystemNotFoundException, SecurityException
get in interface IOServiceIllegalArgumentExceptionFileSystemNotFoundExceptionSecurityExceptionpublic Iterable<FileSystem> getFileSystems()
getFileSystems in interface IOServicepublic FileSystem getFileSystem(URI uri)
getFileSystem in interface IOServicepublic FileSystem newFileSystem(URI uri, Map<String,?> env) throws IllegalArgumentException, FileSystemAlreadyExistsException, ProviderNotFoundException, org.uberfire.java.nio.IOException, SecurityException
newFileSystem in interface IOServiceIllegalArgumentExceptionFileSystemAlreadyExistsExceptionProviderNotFoundExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic void onNewFileSystem(IOService.NewFileSystemListener listener)
onNewFileSystem in interface IOServicepublic InputStream newInputStream(Path path, OpenOption... options) throws IllegalArgumentException, NoSuchFileException, UnsupportedOperationException, org.uberfire.java.nio.IOException, SecurityException
newInputStream in interface IOServiceIllegalArgumentExceptionNoSuchFileExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic DirectoryStream<Path> newDirectoryStream(Path dir) throws IllegalArgumentException, NotDirectoryException, org.uberfire.java.nio.IOException, SecurityException
newDirectoryStream in interface IOServiceIllegalArgumentExceptionNotDirectoryExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic DirectoryStream<Path> newDirectoryStream(Path dir, DirectoryStream.Filter<Path> filter) throws IllegalArgumentException, NotDirectoryException, org.uberfire.java.nio.IOException, SecurityException
newDirectoryStream in interface IOServiceIllegalArgumentExceptionNotDirectoryExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic OutputStream newOutputStream(Path path, OpenOption... options) throws IllegalArgumentException, UnsupportedOperationException, org.uberfire.java.nio.IOException, SecurityException
newOutputStream in interface IOServiceIllegalArgumentExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic org.uberfire.java.nio.channels.SeekableByteChannel newByteChannel(Path path, OpenOption... options) throws IllegalArgumentException, UnsupportedOperationException, FileAlreadyExistsException, org.uberfire.java.nio.IOException, SecurityException
newByteChannel in interface IOServiceIllegalArgumentExceptionUnsupportedOperationExceptionFileAlreadyExistsExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic Path createDirectory(Path dir, Map<String,?> attrs) throws IllegalArgumentException, UnsupportedOperationException, FileAlreadyExistsException, org.uberfire.java.nio.IOException, SecurityException
createDirectory in interface IOServiceIllegalArgumentExceptionUnsupportedOperationExceptionFileAlreadyExistsExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic Path createDirectories(Path dir, Map<String,?> attrs) throws UnsupportedOperationException, FileAlreadyExistsException, org.uberfire.java.nio.IOException, SecurityException
createDirectories in interface IOServiceUnsupportedOperationExceptionFileAlreadyExistsExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic Path createTempFile(String prefix, String suffix, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) throws IllegalArgumentException, UnsupportedOperationException, org.uberfire.java.nio.IOException, SecurityException
createTempFile in interface IOServiceIllegalArgumentExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic Path createTempFile(Path dir, String prefix, String suffix, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) throws IllegalArgumentException, UnsupportedOperationException, org.uberfire.java.nio.IOException, SecurityException
createTempFile in interface IOServiceIllegalArgumentExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic Path createTempDirectory(String prefix, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) throws IllegalArgumentException, UnsupportedOperationException, org.uberfire.java.nio.IOException, SecurityException
createTempDirectory in interface IOServiceIllegalArgumentExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic Path createTempDirectory(Path dir, String prefix, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) throws IllegalArgumentException, UnsupportedOperationException, org.uberfire.java.nio.IOException, SecurityException
createTempDirectory in interface IOServiceIllegalArgumentExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic org.uberfire.java.nio.file.attribute.FileTime getLastModifiedTime(Path path) throws IllegalArgumentException, org.uberfire.java.nio.IOException, SecurityException
getLastModifiedTime in interface IOServiceIllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic Map<String,Object> readAttributes(Path path) throws UnsupportedOperationException, NoSuchFileException, IllegalArgumentException, org.uberfire.java.nio.IOException, SecurityException
readAttributes in interface IOServiceUnsupportedOperationExceptionNoSuchFileExceptionIllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic Path setAttribute(Path path, String attribute, Object value) throws UnsupportedOperationException, IllegalArgumentException, ClassCastException, org.uberfire.java.nio.IOException, SecurityException
setAttribute in interface IOServiceUnsupportedOperationExceptionIllegalArgumentExceptionClassCastExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic Path setAttributes(Path path, Map<String,Object> attrs) throws UnsupportedOperationException, IllegalArgumentException, ClassCastException, org.uberfire.java.nio.IOException, SecurityException
setAttributes in interface IOServiceUnsupportedOperationExceptionIllegalArgumentExceptionClassCastExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic long size(Path path) throws IllegalArgumentException, org.uberfire.java.nio.IOException, SecurityException
size in interface IOServiceIllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic boolean exists(Path path) throws IllegalArgumentException, SecurityException
exists in interface IOServiceIllegalArgumentExceptionSecurityExceptionpublic boolean notExists(Path path) throws IllegalArgumentException, SecurityException
notExists in interface IOServiceIllegalArgumentExceptionSecurityExceptionpublic boolean isSameFile(Path path, Path path2) throws IllegalArgumentException, org.uberfire.java.nio.IOException, SecurityException
isSameFile in interface IOServiceIllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic Path createFile(Path path, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) throws IllegalArgumentException, UnsupportedOperationException, FileAlreadyExistsException, org.uberfire.java.nio.IOException, SecurityException
createFile in interface IOServiceIllegalArgumentExceptionUnsupportedOperationExceptionFileAlreadyExistsExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic BufferedReader newBufferedReader(Path path, Charset cs) throws IllegalArgumentException, NoSuchFileException, org.uberfire.java.nio.IOException, SecurityException
newBufferedReader in interface IOServiceIllegalArgumentExceptionNoSuchFileExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic long copy(Path source, OutputStream out) throws org.uberfire.java.nio.IOException, SecurityException
copy in interface IOServiceorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic byte[] readAllBytes(Path path) throws org.uberfire.java.nio.IOException, OutOfMemoryError, SecurityException
readAllBytes in interface IOServiceorg.uberfire.java.nio.IOExceptionOutOfMemoryErrorSecurityExceptionpublic List<String> readAllLines(Path path) throws IllegalArgumentException, NoSuchFileException, org.uberfire.java.nio.IOException, SecurityException
readAllLines in interface IOServiceIllegalArgumentExceptionNoSuchFileExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic List<String> readAllLines(Path path, Charset cs) throws IllegalArgumentException, NoSuchFileException, org.uberfire.java.nio.IOException, SecurityException
readAllLines in interface IOServiceIllegalArgumentExceptionNoSuchFileExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic String readAllString(Path path, Charset cs) throws IllegalArgumentException, NoSuchFileException, org.uberfire.java.nio.IOException
readAllString in interface IOServiceIllegalArgumentExceptionNoSuchFileExceptionorg.uberfire.java.nio.IOExceptionpublic String readAllString(Path path) throws IllegalArgumentException, NoSuchFileException, org.uberfire.java.nio.IOException
readAllString in interface IOServiceIllegalArgumentExceptionNoSuchFileExceptionorg.uberfire.java.nio.IOExceptionpublic BufferedWriter newBufferedWriter(Path path, Charset cs, OpenOption... options) throws IllegalArgumentException, org.uberfire.java.nio.IOException, UnsupportedOperationException, SecurityException
newBufferedWriter in interface IOServiceIllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionUnsupportedOperationExceptionSecurityExceptionpublic long copy(InputStream in, Path target, CopyOption... options) throws org.uberfire.java.nio.IOException, FileAlreadyExistsException, DirectoryNotEmptyException, UnsupportedOperationException, SecurityException
copy in interface IOServiceorg.uberfire.java.nio.IOExceptionFileAlreadyExistsExceptionDirectoryNotEmptyExceptionUnsupportedOperationExceptionSecurityExceptionpublic Path write(Path path, byte[] bytes, OpenOption... options) throws org.uberfire.java.nio.IOException, UnsupportedOperationException, SecurityException
write in interface IOServiceorg.uberfire.java.nio.IOExceptionUnsupportedOperationExceptionSecurityExceptionpublic Path write(Path path, Iterable<? extends CharSequence> lines, Charset cs, OpenOption... options) throws IllegalArgumentException, org.uberfire.java.nio.IOException, UnsupportedOperationException, SecurityException
write in interface IOServiceIllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionUnsupportedOperationExceptionSecurityExceptionpublic Path write(Path path, String content, Charset cs, OpenOption... options) throws IllegalArgumentException, org.uberfire.java.nio.IOException, UnsupportedOperationException
write in interface IOServiceIllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionUnsupportedOperationExceptionpublic Path write(Path path, String content, OpenOption... options) throws IllegalArgumentException, org.uberfire.java.nio.IOException, UnsupportedOperationException
write in interface IOServiceIllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionUnsupportedOperationExceptionpublic Path write(Path path, String content, Map<String,?> attrs, OpenOption... options) throws IllegalArgumentException, org.uberfire.java.nio.IOException, UnsupportedOperationException
write in interface IOServiceIllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionUnsupportedOperationExceptionpublic Path write(Path path, String content, Charset cs, Map<String,?> attrs, OpenOption... options) throws IllegalArgumentException, org.uberfire.java.nio.IOException, UnsupportedOperationException
write in interface IOServiceIllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionUnsupportedOperationExceptionpublic void dispose()
dispose in interface org.uberfire.commons.lifecycle.Disposablepublic org.uberfire.java.nio.file.attribute.FileAttribute<?>[] convert(Map<String,?> attrs)
public Path write(Path path, byte[] bytes, Map<String,?> attrs, OpenOption... options) throws org.uberfire.java.nio.IOException, UnsupportedOperationException, SecurityException
write in interface IOServiceorg.uberfire.java.nio.IOExceptionUnsupportedOperationExceptionSecurityExceptionpublic Path write(Path path, String content, Set<? extends OpenOption> options, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) throws IllegalArgumentException, org.uberfire.java.nio.IOException, UnsupportedOperationException
write in interface IOServiceIllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionUnsupportedOperationExceptionpublic Path write(Path path, String content, Charset cs, Set<? extends OpenOption> options, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) throws IllegalArgumentException, org.uberfire.java.nio.IOException, UnsupportedOperationException
write in interface IOServiceIllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionUnsupportedOperationExceptionpublic Path write(Path path, byte[] bytes, Set<? extends OpenOption> options, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) throws IllegalArgumentException, org.uberfire.java.nio.IOException, UnsupportedOperationException
write in interface IOServiceIllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionUnsupportedOperationExceptionprotected abstract Set<? extends OpenOption> buildOptions(Set<? extends OpenOption> options, OpenOption... other)
public String getId()
getId in interface IOServiceIdentifiableCopyright © 2012–2017 JBoss by Red Hat. All rights reserved.