Kie Commons I/O 6.0.0.Beta3

org.kie.commons.io.impl.cluster
Class IOServiceClusterImpl

java.lang.Object
  extended by org.kie.commons.io.impl.cluster.IOServiceClusterImpl
All Implemented Interfaces:
IOService

public class IOServiceClusterImpl
extends Object
implements IOService


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.kie.commons.io.IOService
IOService.NewFileSystemListener
 
Field Summary
 
Fields inherited from interface org.kie.commons.io.IOService
EMPTY_OPTIONS
 
Constructor Summary
IOServiceClusterImpl(IOService service, ClusterServiceFactory clusterServiceFactory)
           
 
Method Summary
 FileAttribute<?>[] convert(Map<String,?> attrs)
           
 long copy(InputStream in, Path target, CopyOption... options)
           
 long copy(Path source, OutputStream out)
           
 Path copy(Path source, Path target, CopyOption... options)
           
 Path createDirectories(Path dir, FileAttribute<?>... attrs)
           
 Path createDirectories(Path dir, Map<String,?> attrs)
           
 Path createDirectory(Path dir, FileAttribute<?>... attrs)
           
 Path createDirectory(Path dir, Map<String,?> attrs)
           
 Path createFile(Path path, FileAttribute<?>... attrs)
           
 Path createTempDirectory(Path dir, String prefix, FileAttribute<?>... attrs)
           
 Path createTempDirectory(String prefix, FileAttribute<?>... attrs)
           
 Path createTempFile(Path dir, String prefix, String suffix, FileAttribute<?>... attrs)
           
 Path createTempFile(String prefix, String suffix, FileAttribute<?>... attrs)
           
 void delete(Path path)
           
 boolean deleteIfExists(Path path)
           
 void endBatch()
           
 boolean exists(Path path)
           
 Path get(String first, String... more)
           
 Path get(URI uri)
           
 Object getAttribute(Path path, String attribute)
           
<V extends FileAttributeView>
V
getFileAttributeView(Path path, Class<V> type)
           
 FileSystem getFileSystem(URI uri)
           
 Iterable<FileSystem> getFileSystems()
           
 Iterable<FileSystem> getFileSystems(FileSystemType type)
           
 FileTime getLastModifiedTime(Path path)
           
 boolean isSameFile(Path path, Path path2)
           
 Path move(Path source, Path target, CopyOption... options)
           
 BufferedReader newBufferedReader(Path path, Charset cs)
           
 BufferedWriter newBufferedWriter(Path path, Charset cs, OpenOption... options)
           
 SeekableByteChannel newByteChannel(Path path, OpenOption... options)
           
 SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs)
           
 DirectoryStream<Path> newDirectoryStream(Path dir)
           
 DirectoryStream<Path> newDirectoryStream(Path dir, DirectoryStream.Filter<Path> filter)
           
 FileSystem newFileSystem(URI uri, Map<String,?> env)
           
 FileSystem newFileSystem(URI uri, Map<String,?> env, FileSystemType type)
           
 InputStream newInputStream(Path path, OpenOption... options)
           
 OutputStream newOutputStream(Path path, OpenOption... options)
           
 boolean notExists(Path path)
           
 void onNewFileSystem(IOService.NewFileSystemListener listener)
           
 byte[] readAllBytes(Path path)
           
 List<String> readAllLines(Path path)
           
 List<String> readAllLines(Path path, Charset cs)
           
 String readAllString(Path path)
           
 String readAllString(Path path, Charset cs)
           
 Map<String,Object> readAttributes(Path path)
           
 Map<String,Object> readAttributes(Path path, String attributes)
           
 Path setAttribute(Path path, String attribute, Object value)
           
 Path setAttributes(Path path, FileAttribute<?>... attrs)
           
 Path setAttributes(Path path, Map<String,Object> attrs)
           
 long size(Path path)
           
 void startBatch()
           
 Path write(Path path, byte[] bytes, Map<String,?> attrs, OpenOption... options)
           
 Path write(Path path, byte[] bytes, OpenOption... options)
           
 Path write(Path path, byte[] bytes, Set<? extends OpenOption> options, FileAttribute<?>... attrs)
           
 Path write(Path path, Iterable<? extends CharSequence> lines, Charset cs, OpenOption... options)
           
 Path write(Path path, String content, Charset cs, Map<String,?> attrs, OpenOption... options)
           
 Path write(Path path, String content, Charset cs, OpenOption... options)
           
 Path write(Path path, String content, Charset cs, Set<? extends OpenOption> options, FileAttribute<?>... attrs)
           
 Path write(Path path, String content, Map<String,?> attrs, OpenOption... options)
           
 Path write(Path path, String content, OpenOption... options)
           
 Path write(Path path, String content, Set<? extends OpenOption> options, FileAttribute<?>... attrs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOServiceClusterImpl

public IOServiceClusterImpl(IOService service,
                            ClusterServiceFactory clusterServiceFactory)
Method Detail

startBatch

public void startBatch()
Specified by:
startBatch in interface IOService

endBatch

public void endBatch()
Specified by:
endBatch in interface IOService

convert

public FileAttribute<?>[] convert(Map<String,?> attrs)
Specified by:
convert in interface IOService

get

public Path get(String first,
                String... more)
         throws IllegalArgumentException
Specified by:
get in interface IOService
Throws:
IllegalArgumentException

get

public Path get(URI uri)
         throws IllegalArgumentException,
                FileSystemNotFoundException,
                SecurityException
Specified by:
get in interface IOService
Throws:
IllegalArgumentException
FileSystemNotFoundException
SecurityException

getFileSystems

public Iterable<FileSystem> getFileSystems()
Specified by:
getFileSystems in interface IOService

getFileSystems

public Iterable<FileSystem> getFileSystems(FileSystemType type)
Specified by:
getFileSystems in interface IOService

getFileSystem

public FileSystem getFileSystem(URI uri)
                         throws IllegalArgumentException,
                                FileSystemNotFoundException,
                                ProviderNotFoundException,
                                SecurityException
Specified by:
getFileSystem in interface IOService
Throws:
IllegalArgumentException
FileSystemNotFoundException
ProviderNotFoundException
SecurityException

newFileSystem

public FileSystem newFileSystem(URI uri,
                                Map<String,?> env)
                         throws IllegalArgumentException,
                                FileSystemAlreadyExistsException,
                                ProviderNotFoundException,
                                IOException,
                                SecurityException
Specified by:
newFileSystem in interface IOService
Throws:
IllegalArgumentException
FileSystemAlreadyExistsException
ProviderNotFoundException
IOException
SecurityException

newFileSystem

public FileSystem newFileSystem(URI uri,
                                Map<String,?> env,
                                FileSystemType type)
                         throws IllegalArgumentException,
                                FileSystemAlreadyExistsException,
                                ProviderNotFoundException,
                                IOException,
                                SecurityException
Specified by:
newFileSystem in interface IOService
Throws:
IllegalArgumentException
FileSystemAlreadyExistsException
ProviderNotFoundException
IOException
SecurityException

onNewFileSystem

public void onNewFileSystem(IOService.NewFileSystemListener listener)
Specified by:
onNewFileSystem in interface IOService

newInputStream

public InputStream newInputStream(Path path,
                                  OpenOption... options)
                           throws IllegalArgumentException,
                                  NoSuchFileException,
                                  UnsupportedOperationException,
                                  IOException,
                                  SecurityException
Specified by:
newInputStream in interface IOService
Throws:
IllegalArgumentException
NoSuchFileException
UnsupportedOperationException
IOException
SecurityException

newDirectoryStream

public DirectoryStream<Path> newDirectoryStream(Path dir)
                                         throws IllegalArgumentException,
                                                NotDirectoryException,
                                                IOException,
                                                SecurityException
Specified by:
newDirectoryStream in interface IOService
Throws:
IllegalArgumentException
NotDirectoryException
IOException
SecurityException

newDirectoryStream

public DirectoryStream<Path> newDirectoryStream(Path dir,
                                                DirectoryStream.Filter<Path> filter)
                                         throws IllegalArgumentException,
                                                NotDirectoryException,
                                                IOException,
                                                SecurityException
Specified by:
newDirectoryStream in interface IOService
Throws:
IllegalArgumentException
NotDirectoryException
IOException
SecurityException

createFile

public Path createFile(Path path,
                       FileAttribute<?>... attrs)
                throws IllegalArgumentException,
                       UnsupportedOperationException,
                       FileAlreadyExistsException,
                       IOException,
                       SecurityException
Specified by:
createFile in interface IOService
Throws:
IllegalArgumentException
UnsupportedOperationException
FileAlreadyExistsException
IOException
SecurityException

createDirectory

public Path createDirectory(Path dir,
                            FileAttribute<?>... attrs)
                     throws IllegalArgumentException,
                            UnsupportedOperationException,
                            FileAlreadyExistsException,
                            IOException,
                            SecurityException
Specified by:
createDirectory in interface IOService
Throws:
IllegalArgumentException
UnsupportedOperationException
FileAlreadyExistsException
IOException
SecurityException

createDirectories

public Path createDirectories(Path dir,
                              FileAttribute<?>... attrs)
                       throws UnsupportedOperationException,
                              FileAlreadyExistsException,
                              IOException,
                              SecurityException
Specified by:
createDirectories in interface IOService
Throws:
UnsupportedOperationException
FileAlreadyExistsException
IOException
SecurityException

createDirectory

public Path createDirectory(Path dir,
                            Map<String,?> attrs)
                     throws IllegalArgumentException,
                            UnsupportedOperationException,
                            FileAlreadyExistsException,
                            IOException,
                            SecurityException
Specified by:
createDirectory in interface IOService
Throws:
IllegalArgumentException
UnsupportedOperationException
FileAlreadyExistsException
IOException
SecurityException

createDirectories

public Path createDirectories(Path dir,
                              Map<String,?> attrs)
                       throws UnsupportedOperationException,
                              FileAlreadyExistsException,
                              IOException,
                              SecurityException
Specified by:
createDirectories in interface IOService
Throws:
UnsupportedOperationException
FileAlreadyExistsException
IOException
SecurityException

delete

public void delete(Path path)
            throws IllegalArgumentException,
                   NoSuchFileException,
                   DirectoryNotEmptyException,
                   IOException,
                   SecurityException
Specified by:
delete in interface IOService
Throws:
IllegalArgumentException
NoSuchFileException
DirectoryNotEmptyException
IOException
SecurityException

deleteIfExists

public boolean deleteIfExists(Path path)
                       throws IllegalArgumentException,
                              DirectoryNotEmptyException,
                              IOException,
                              SecurityException
Specified by:
deleteIfExists in interface IOService
Throws:
IllegalArgumentException
DirectoryNotEmptyException
IOException
SecurityException

createTempFile

public Path createTempFile(String prefix,
                           String suffix,
                           FileAttribute<?>... attrs)
                    throws IllegalArgumentException,
                           UnsupportedOperationException,
                           IOException,
                           SecurityException
Specified by:
createTempFile in interface IOService
Throws:
IllegalArgumentException
UnsupportedOperationException
IOException
SecurityException

createTempFile

public Path createTempFile(Path dir,
                           String prefix,
                           String suffix,
                           FileAttribute<?>... attrs)
                    throws IllegalArgumentException,
                           UnsupportedOperationException,
                           IOException,
                           SecurityException
Specified by:
createTempFile in interface IOService
Throws:
IllegalArgumentException
UnsupportedOperationException
IOException
SecurityException

createTempDirectory

public Path createTempDirectory(String prefix,
                                FileAttribute<?>... attrs)
                         throws IllegalArgumentException,
                                UnsupportedOperationException,
                                IOException,
                                SecurityException
Specified by:
createTempDirectory in interface IOService
Throws:
IllegalArgumentException
UnsupportedOperationException
IOException
SecurityException

createTempDirectory

public Path createTempDirectory(Path dir,
                                String prefix,
                                FileAttribute<?>... attrs)
                         throws IllegalArgumentException,
                                UnsupportedOperationException,
                                IOException,
                                SecurityException
Specified by:
createTempDirectory in interface IOService
Throws:
IllegalArgumentException
UnsupportedOperationException
IOException
SecurityException

copy

public Path copy(Path source,
                 Path target,
                 CopyOption... options)
          throws UnsupportedOperationException,
                 FileAlreadyExistsException,
                 DirectoryNotEmptyException,
                 IOException,
                 SecurityException
Specified by:
copy in interface IOService
Throws:
UnsupportedOperationException
FileAlreadyExistsException
DirectoryNotEmptyException
IOException
SecurityException

copy

public long copy(InputStream in,
                 Path target,
                 CopyOption... options)
          throws IOException,
                 FileAlreadyExistsException,
                 DirectoryNotEmptyException,
                 UnsupportedOperationException,
                 SecurityException
Specified by:
copy in interface IOService
Throws:
IOException
FileAlreadyExistsException
DirectoryNotEmptyException
UnsupportedOperationException
SecurityException

copy

public long copy(Path source,
                 OutputStream out)
          throws IOException,
                 SecurityException
Specified by:
copy in interface IOService
Throws:
IOException
SecurityException

move

public Path move(Path source,
                 Path target,
                 CopyOption... options)
          throws UnsupportedOperationException,
                 FileAlreadyExistsException,
                 DirectoryNotEmptyException,
                 AtomicMoveNotSupportedException,
                 IOException,
                 SecurityException
Specified by:
move in interface IOService
Throws:
UnsupportedOperationException
FileAlreadyExistsException
DirectoryNotEmptyException
AtomicMoveNotSupportedException
IOException
SecurityException

getFileAttributeView

public <V extends FileAttributeView> V getFileAttributeView(Path path,
                                                            Class<V> type)
                                                 throws IllegalArgumentException
Specified by:
getFileAttributeView in interface IOService
Throws:
IllegalArgumentException

readAttributes

public Map<String,Object> readAttributes(Path path)
                                  throws UnsupportedOperationException,
                                         NoSuchFileException,
                                         IllegalArgumentException,
                                         IOException,
                                         SecurityException
Specified by:
readAttributes in interface IOService
Throws:
UnsupportedOperationException
NoSuchFileException
IllegalArgumentException
IOException
SecurityException

readAttributes

public Map<String,Object> readAttributes(Path path,
                                         String attributes)
                                  throws UnsupportedOperationException,
                                         NoSuchFileException,
                                         IllegalArgumentException,
                                         IOException,
                                         SecurityException
Specified by:
readAttributes in interface IOService
Throws:
UnsupportedOperationException
NoSuchFileException
IllegalArgumentException
IOException
SecurityException

setAttributes

public Path setAttributes(Path path,
                          FileAttribute<?>... attrs)
                   throws UnsupportedOperationException,
                          IllegalArgumentException,
                          ClassCastException,
                          IOException,
                          SecurityException
Specified by:
setAttributes in interface IOService
Throws:
UnsupportedOperationException
IllegalArgumentException
ClassCastException
IOException
SecurityException

setAttributes

public Path setAttributes(Path path,
                          Map<String,Object> attrs)
                   throws UnsupportedOperationException,
                          IllegalArgumentException,
                          ClassCastException,
                          IOException,
                          SecurityException
Specified by:
setAttributes in interface IOService
Throws:
UnsupportedOperationException
IllegalArgumentException
ClassCastException
IOException
SecurityException

setAttribute

public Path setAttribute(Path path,
                         String attribute,
                         Object value)
                  throws UnsupportedOperationException,
                         IllegalArgumentException,
                         ClassCastException,
                         IOException,
                         SecurityException
Specified by:
setAttribute in interface IOService
Throws:
UnsupportedOperationException
IllegalArgumentException
ClassCastException
IOException
SecurityException

getAttribute

public Object getAttribute(Path path,
                           String attribute)
                    throws UnsupportedOperationException,
                           IllegalArgumentException,
                           IOException,
                           SecurityException
Specified by:
getAttribute in interface IOService
Throws:
UnsupportedOperationException
IllegalArgumentException
IOException
SecurityException

getLastModifiedTime

public FileTime getLastModifiedTime(Path path)
                             throws IllegalArgumentException,
                                    IOException,
                                    SecurityException
Specified by:
getLastModifiedTime in interface IOService
Throws:
IllegalArgumentException
IOException
SecurityException

size

public long size(Path path)
          throws IllegalArgumentException,
                 IOException,
                 SecurityException
Specified by:
size in interface IOService
Throws:
IllegalArgumentException
IOException
SecurityException

exists

public boolean exists(Path path)
               throws IllegalArgumentException,
                      SecurityException
Specified by:
exists in interface IOService
Throws:
IllegalArgumentException
SecurityException

notExists

public boolean notExists(Path path)
                  throws IllegalArgumentException,
                         SecurityException
Specified by:
notExists in interface IOService
Throws:
IllegalArgumentException
SecurityException

isSameFile

public boolean isSameFile(Path path,
                          Path path2)
                   throws IllegalArgumentException,
                          IOException,
                          SecurityException
Specified by:
isSameFile in interface IOService
Throws:
IllegalArgumentException
IOException
SecurityException

newBufferedReader

public BufferedReader newBufferedReader(Path path,
                                        Charset cs)
                                 throws IllegalArgumentException,
                                        NoSuchFileException,
                                        IOException,
                                        SecurityException
Specified by:
newBufferedReader in interface IOService
Throws:
IllegalArgumentException
NoSuchFileException
IOException
SecurityException

readAllBytes

public byte[] readAllBytes(Path path)
                    throws IOException,
                           OutOfMemoryError,
                           SecurityException
Specified by:
readAllBytes in interface IOService
Throws:
IOException
OutOfMemoryError
SecurityException

readAllLines

public List<String> readAllLines(Path path)
                          throws IllegalArgumentException,
                                 NoSuchFileException,
                                 IOException,
                                 SecurityException
Specified by:
readAllLines in interface IOService
Throws:
IllegalArgumentException
NoSuchFileException
IOException
SecurityException

readAllLines

public List<String> readAllLines(Path path,
                                 Charset cs)
                          throws IllegalArgumentException,
                                 NoSuchFileException,
                                 IOException,
                                 SecurityException
Specified by:
readAllLines in interface IOService
Throws:
IllegalArgumentException
NoSuchFileException
IOException
SecurityException

readAllString

public String readAllString(Path path,
                            Charset cs)
                     throws IllegalArgumentException,
                            NoSuchFileException,
                            IOException
Specified by:
readAllString in interface IOService
Throws:
IllegalArgumentException
NoSuchFileException
IOException

readAllString

public String readAllString(Path path)
                     throws IllegalArgumentException,
                            NoSuchFileException,
                            IOException
Specified by:
readAllString in interface IOService
Throws:
IllegalArgumentException
NoSuchFileException
IOException

write

public Path write(Path path,
                  byte[] bytes,
                  OpenOption... options)
           throws IOException,
                  UnsupportedOperationException,
                  SecurityException
Specified by:
write in interface IOService
Throws:
IOException
UnsupportedOperationException
SecurityException

write

public Path write(Path path,
                  byte[] bytes,
                  Map<String,?> attrs,
                  OpenOption... options)
           throws IOException,
                  UnsupportedOperationException,
                  SecurityException
Specified by:
write in interface IOService
Throws:
IOException
UnsupportedOperationException
SecurityException

write

public Path write(Path path,
                  byte[] bytes,
                  Set<? extends OpenOption> options,
                  FileAttribute<?>... attrs)
           throws IllegalArgumentException,
                  IOException,
                  UnsupportedOperationException
Specified by:
write in interface IOService
Throws:
IllegalArgumentException
IOException
UnsupportedOperationException

write

public Path write(Path path,
                  Iterable<? extends CharSequence> lines,
                  Charset cs,
                  OpenOption... options)
           throws IllegalArgumentException,
                  IOException,
                  UnsupportedOperationException,
                  SecurityException
Specified by:
write in interface IOService
Throws:
IllegalArgumentException
IOException
UnsupportedOperationException
SecurityException

write

public Path write(Path path,
                  String content,
                  OpenOption... options)
           throws IllegalArgumentException,
                  IOException,
                  UnsupportedOperationException
Specified by:
write in interface IOService
Throws:
IllegalArgumentException
IOException
UnsupportedOperationException

write

public Path write(Path path,
                  String content,
                  Charset cs,
                  OpenOption... options)
           throws IllegalArgumentException,
                  IOException,
                  UnsupportedOperationException
Specified by:
write in interface IOService
Throws:
IllegalArgumentException
IOException
UnsupportedOperationException

write

public Path write(Path path,
                  String content,
                  Set<? extends OpenOption> options,
                  FileAttribute<?>... attrs)
           throws IllegalArgumentException,
                  IOException,
                  UnsupportedOperationException
Specified by:
write in interface IOService
Throws:
IllegalArgumentException
IOException
UnsupportedOperationException

write

public Path write(Path path,
                  String content,
                  Charset cs,
                  Set<? extends OpenOption> options,
                  FileAttribute<?>... attrs)
           throws IllegalArgumentException,
                  IOException,
                  UnsupportedOperationException
Specified by:
write in interface IOService
Throws:
IllegalArgumentException
IOException
UnsupportedOperationException

write

public Path write(Path path,
                  String content,
                  Map<String,?> attrs,
                  OpenOption... options)
           throws IllegalArgumentException,
                  IOException,
                  UnsupportedOperationException
Specified by:
write in interface IOService
Throws:
IllegalArgumentException
IOException
UnsupportedOperationException

write

public Path write(Path path,
                  String content,
                  Charset cs,
                  Map<String,?> attrs,
                  OpenOption... options)
           throws IllegalArgumentException,
                  IOException,
                  UnsupportedOperationException
Specified by:
write in interface IOService
Throws:
IllegalArgumentException
IOException
UnsupportedOperationException

newOutputStream

public OutputStream newOutputStream(Path path,
                                    OpenOption... options)
                             throws IllegalArgumentException,
                                    UnsupportedOperationException,
                                    IOException,
                                    SecurityException
Specified by:
newOutputStream in interface IOService
Throws:
IllegalArgumentException
UnsupportedOperationException
IOException
SecurityException

newByteChannel

public SeekableByteChannel newByteChannel(Path path,
                                          OpenOption... options)
                                   throws IllegalArgumentException,
                                          UnsupportedOperationException,
                                          FileAlreadyExistsException,
                                          IOException,
                                          SecurityException
Specified by:
newByteChannel in interface IOService
Throws:
IllegalArgumentException
UnsupportedOperationException
FileAlreadyExistsException
IOException
SecurityException

newByteChannel

public SeekableByteChannel newByteChannel(Path path,
                                          Set<? extends OpenOption> options,
                                          FileAttribute<?>... attrs)
                                   throws IllegalArgumentException,
                                          UnsupportedOperationException,
                                          FileAlreadyExistsException,
                                          IOException,
                                          SecurityException
Specified by:
newByteChannel in interface IOService
Throws:
IllegalArgumentException
UnsupportedOperationException
FileAlreadyExistsException
IOException
SecurityException

newBufferedWriter

public BufferedWriter newBufferedWriter(Path path,
                                        Charset cs,
                                        OpenOption... options)
                                 throws IllegalArgumentException,
                                        IOException,
                                        UnsupportedOperationException,
                                        SecurityException
Specified by:
newBufferedWriter in interface IOService
Throws:
IllegalArgumentException
IOException
UnsupportedOperationException
SecurityException

Kie Commons I/O 6.0.0.Beta3

Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.