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<FileSystemMetadata> |
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, setAttributespriorityprotected static final String DEFAULT_SERVICE_NAME
protected static final Charset UTF_8
protected final IOWatchService ioWatchService
protected final Set<FileSystemMetadata> 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 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<FileSystemMetadata> getFileSystemMetadata()
getFileSystemMetadata in interface IOServicepublic FileSystem getFileSystem(URI uri)
getFileSystem in interface IOServicepublic FileSystem newFileSystem(URI uri, Map<String,?> env) throws IllegalArgumentException, FileSystemAlreadyExistsException, ProviderNotFoundException, IOException, SecurityException
newFileSystem in interface IOServiceIllegalArgumentExceptionFileSystemAlreadyExistsExceptionProviderNotFoundExceptionIOExceptionSecurityExceptionpublic void onNewFileSystem(IOService.NewFileSystemListener listener)
onNewFileSystem in interface IOServicepublic InputStream newInputStream(Path path, OpenOption... options) throws IllegalArgumentException, NoSuchFileException, UnsupportedOperationException, IOException, SecurityException
newInputStream in interface IOServiceIllegalArgumentExceptionNoSuchFileExceptionUnsupportedOperationExceptionIOExceptionSecurityExceptionpublic DirectoryStream<Path> newDirectoryStream(Path dir) throws IllegalArgumentException, NotDirectoryException, IOException, SecurityException
newDirectoryStream in interface IOServiceIllegalArgumentExceptionNotDirectoryExceptionIOExceptionSecurityExceptionpublic DirectoryStream<Path> newDirectoryStream(Path dir, DirectoryStream.Filter<Path> filter) throws IllegalArgumentException, NotDirectoryException, IOException, SecurityException
newDirectoryStream in interface IOServiceIllegalArgumentExceptionNotDirectoryExceptionIOExceptionSecurityExceptionpublic OutputStream newOutputStream(Path path, OpenOption... options) throws IllegalArgumentException, UnsupportedOperationException, IOException, SecurityException
newOutputStream in interface IOServiceIllegalArgumentExceptionUnsupportedOperationExceptionIOExceptionSecurityExceptionpublic SeekableByteChannel newByteChannel(Path path, OpenOption... options) throws IllegalArgumentException, UnsupportedOperationException, FileAlreadyExistsException, IOException, SecurityException
newByteChannel in interface IOServiceIllegalArgumentExceptionUnsupportedOperationExceptionFileAlreadyExistsExceptionIOExceptionSecurityExceptionpublic Path createDirectory(Path dir, Map<String,?> attrs) throws IllegalArgumentException, UnsupportedOperationException, FileAlreadyExistsException, IOException, SecurityException
createDirectory in interface IOServiceIllegalArgumentExceptionUnsupportedOperationExceptionFileAlreadyExistsExceptionIOExceptionSecurityExceptionpublic Path createDirectories(Path dir, Map<String,?> attrs) throws UnsupportedOperationException, FileAlreadyExistsException, IOException, SecurityException
createDirectories in interface IOServiceUnsupportedOperationExceptionFileAlreadyExistsExceptionIOExceptionSecurityExceptionpublic Path createTempFile(String prefix, String suffix, FileAttribute<?>... attrs) throws IllegalArgumentException, UnsupportedOperationException, IOException, SecurityException
createTempFile in interface IOServiceIllegalArgumentExceptionUnsupportedOperationExceptionIOExceptionSecurityExceptionpublic Path createTempFile(Path dir, String prefix, String suffix, FileAttribute<?>... attrs) throws IllegalArgumentException, UnsupportedOperationException, IOException, SecurityException
createTempFile in interface IOServiceIllegalArgumentExceptionUnsupportedOperationExceptionIOExceptionSecurityExceptionpublic Path createTempDirectory(String prefix, FileAttribute<?>... attrs) throws IllegalArgumentException, UnsupportedOperationException, IOException, SecurityException
createTempDirectory in interface IOServiceIllegalArgumentExceptionUnsupportedOperationExceptionIOExceptionSecurityExceptionpublic Path createTempDirectory(Path dir, String prefix, FileAttribute<?>... attrs) throws IllegalArgumentException, UnsupportedOperationException, IOException, SecurityException
createTempDirectory in interface IOServiceIllegalArgumentExceptionUnsupportedOperationExceptionIOExceptionSecurityExceptionpublic FileTime getLastModifiedTime(Path path) throws IllegalArgumentException, IOException, SecurityException
getLastModifiedTime in interface IOServiceIllegalArgumentExceptionIOExceptionSecurityExceptionpublic Path setAttribute(Path path, String attribute, Object value) throws UnsupportedOperationException, IllegalArgumentException, ClassCastException, IOException, SecurityException
setAttribute in interface IOServiceUnsupportedOperationExceptionIllegalArgumentExceptionClassCastExceptionIOExceptionSecurityExceptionpublic Map<String,Object> readAttributes(Path path) throws UnsupportedOperationException, NoSuchFileException, IllegalArgumentException, IOException, SecurityException
readAttributes in interface IOServiceUnsupportedOperationExceptionNoSuchFileExceptionIllegalArgumentExceptionIOExceptionSecurityExceptionpublic Path setAttributes(Path path, Map<String,Object> attrs) throws UnsupportedOperationException, IllegalArgumentException, ClassCastException, IOException, SecurityException
setAttributes in interface IOServiceUnsupportedOperationExceptionIllegalArgumentExceptionClassCastExceptionIOExceptionSecurityExceptionpublic long size(Path path) throws IllegalArgumentException, IOException, SecurityException
size in interface IOServiceIllegalArgumentExceptionIOExceptionSecurityExceptionpublic 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, IOException, SecurityException
isSameFile in interface IOServiceIllegalArgumentExceptionIOExceptionSecurityExceptionpublic Path createFile(Path path, FileAttribute<?>... attrs) throws IllegalArgumentException, UnsupportedOperationException, FileAlreadyExistsException, IOException, SecurityException
createFile in interface IOServiceIllegalArgumentExceptionUnsupportedOperationExceptionFileAlreadyExistsExceptionIOExceptionSecurityExceptionpublic BufferedReader newBufferedReader(Path path, Charset cs) throws IllegalArgumentException, NoSuchFileException, IOException, SecurityException
newBufferedReader in interface IOServiceIllegalArgumentExceptionNoSuchFileExceptionIOExceptionSecurityExceptionpublic long copy(Path source, OutputStream out) throws IOException, SecurityException
copy in interface IOServiceIOExceptionSecurityExceptionpublic byte[] readAllBytes(Path path) throws IOException, OutOfMemoryError, SecurityException
readAllBytes in interface IOServiceIOExceptionOutOfMemoryErrorSecurityExceptionpublic List<String> readAllLines(Path path) throws IllegalArgumentException, NoSuchFileException, IOException, SecurityException
readAllLines in interface IOServiceIllegalArgumentExceptionNoSuchFileExceptionIOExceptionSecurityExceptionpublic List<String> readAllLines(Path path, Charset cs) throws IllegalArgumentException, NoSuchFileException, IOException, SecurityException
readAllLines in interface IOServiceIllegalArgumentExceptionNoSuchFileExceptionIOExceptionSecurityExceptionpublic String readAllString(Path path, Charset cs) throws IllegalArgumentException, NoSuchFileException, IOException
readAllString in interface IOServiceIllegalArgumentExceptionNoSuchFileExceptionIOExceptionpublic String readAllString(Path path) throws IllegalArgumentException, NoSuchFileException, IOException
readAllString in interface IOServiceIllegalArgumentExceptionNoSuchFileExceptionIOExceptionpublic BufferedWriter newBufferedWriter(Path path, Charset cs, OpenOption... options) throws IllegalArgumentException, IOException, UnsupportedOperationException, SecurityException
newBufferedWriter in interface IOServiceIllegalArgumentExceptionIOExceptionUnsupportedOperationExceptionSecurityExceptionpublic long copy(InputStream in, Path target, CopyOption... options) throws IOException, FileAlreadyExistsException, DirectoryNotEmptyException, UnsupportedOperationException, SecurityException
copy in interface IOServiceIOExceptionFileAlreadyExistsExceptionDirectoryNotEmptyExceptionUnsupportedOperationExceptionSecurityExceptionpublic Path write(Path path, byte[] bytes, OpenOption... options) throws IOException, UnsupportedOperationException, SecurityException
write in interface IOServiceIOExceptionUnsupportedOperationExceptionSecurityExceptionpublic Path write(Path path, Iterable<? extends CharSequence> lines, Charset cs, OpenOption... options) throws IllegalArgumentException, IOException, UnsupportedOperationException, SecurityException
write in interface IOServiceIllegalArgumentExceptionIOExceptionUnsupportedOperationExceptionSecurityExceptionpublic Path write(Path path, String content, Charset cs, OpenOption... options) throws IllegalArgumentException, IOException, UnsupportedOperationException
write in interface IOServiceIllegalArgumentExceptionIOExceptionUnsupportedOperationExceptionpublic Path write(Path path, String content, OpenOption... options) throws IllegalArgumentException, IOException, UnsupportedOperationException
write in interface IOServiceIllegalArgumentExceptionIOExceptionUnsupportedOperationExceptionpublic Path write(Path path, String content, Map<String,?> attrs, OpenOption... options) throws IllegalArgumentException, IOException, UnsupportedOperationException
write in interface IOServiceIllegalArgumentExceptionIOExceptionUnsupportedOperationExceptionpublic Path write(Path path, String content, Charset cs, Map<String,?> attrs, OpenOption... options) throws IllegalArgumentException, IOException, UnsupportedOperationException
write in interface IOServiceIllegalArgumentExceptionIOExceptionUnsupportedOperationExceptionpublic void dispose()
dispose in interface Disposablepublic FileAttribute<?>[] convert(Map<String,?> attrs)
public Path write(Path path, byte[] bytes, Map<String,?> attrs, OpenOption... options) throws IOException, UnsupportedOperationException, SecurityException
write in interface IOServiceIOExceptionUnsupportedOperationExceptionSecurityExceptionpublic Path write(Path path, String content, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IllegalArgumentException, IOException, UnsupportedOperationException
write in interface IOServiceIllegalArgumentExceptionIOExceptionUnsupportedOperationExceptionpublic Path write(Path path, String content, Charset cs, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IllegalArgumentException, IOException, UnsupportedOperationException
write in interface IOServiceIllegalArgumentExceptionIOExceptionUnsupportedOperationExceptionpublic Path write(Path path, byte[] bytes, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IllegalArgumentException, IOException, UnsupportedOperationException
write in interface IOServiceIllegalArgumentExceptionIOExceptionUnsupportedOperationExceptionprotected abstract Set<? extends OpenOption> buildOptions(Set<? extends OpenOption> options, OpenOption... other)
public String getId()
getId in interface IOServiceIdentifiableCopyright © 2012–2020 JBoss by Red Hat. All rights reserved.