Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2012 JBoss Inc
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *       http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 package org.uberfire.io;
 
 import java.net.URI;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
 import  org.uberfire.commons.lifecycle.Disposable;
 import  org.uberfire.commons.lifecycle.PriorityDisposable;
 import  org.uberfire.java.nio.IOException;
 import  org.uberfire.java.nio.channels.SeekableByteChannel;
 import  org.uberfire.java.nio.file.AtomicMoveNotSupportedException;
 import  org.uberfire.java.nio.file.CopyOption;
 import  org.uberfire.java.nio.file.DeleteOption;
 import  org.uberfire.java.nio.file.DirectoryNotEmptyException;
 import  org.uberfire.java.nio.file.DirectoryStream;
 import  org.uberfire.java.nio.file.FileAlreadyExistsException;
 import  org.uberfire.java.nio.file.FileSystem;
 import  org.uberfire.java.nio.file.FileSystemAlreadyExistsException;
 import  org.uberfire.java.nio.file.FileSystemNotFoundException;
 import  org.uberfire.java.nio.file.NoSuchFileException;
 import  org.uberfire.java.nio.file.NotDirectoryException;
 import  org.uberfire.java.nio.file.OpenOption;
 import  org.uberfire.java.nio.file.Option;
 import  org.uberfire.java.nio.file.Path;
 import  org.uberfire.java.nio.file.ProviderNotFoundException;
 import  org.uberfire.java.nio.file.attribute.FileAttribute;
 import  org.uberfire.java.nio.file.attribute.FileAttributeView;
 import  org.uberfire.java.nio.file.attribute.FileTime;

 
 public interface IOService extends PriorityDisposable {
 
     public static Set<OpenOption> EMPTY_OPTIONS = new HashSet<OpenOption>();
 
     void startBatchfinal FileSystem fs );
 
     void startBatchfinal FileSystem[] fs,
                      final Option... options );
 
     void startBatchfinal FileSystem fs,
                      final Option... options );
 
     void startBatchfinal FileSystem... fs );
 
     void endBatch();
 
     FileAttribute<?>[] convertfinal Map<String, ?> attrs );
 
     Path getfinal String first,
               final String... more )
             throws IllegalArgumentException;
 
     Path getfinal URI uri )
             throws IllegalArgumentException, FileSystemNotFoundException, SecurityException;
 
     Iterable<FileSystem> getFileSystems();
 
     FileSystem getFileSystemfinal URI uri )
             throws IllegalArgumentException, FileSystemNotFoundException,
             ProviderNotFoundException, SecurityException;
 
     FileSystem newFileSystemfinal URI uri,
                               final Map<String, ?> env )
             throws IllegalArgumentException, FileSystemAlreadyExistsException,
             ProviderNotFoundException, IOException, SecurityException;
 
     void onNewFileSystemfinal NewFileSystemListener listener );
 
     InputStream newInputStreamfinal Path path,
                                 final OpenOption... options )
             throws IllegalArgumentException, NoSuchFileException,
             UnsupportedOperationException, IOException, SecurityException;
 
     OutputStream newOutputStreamfinal Path path,
                                  final OpenOption... options )
            IOException, SecurityException;
    SeekableByteChannel newByteChannelfinal Path path,
                                        final OpenOption... options )
            throws IllegalArgumentExceptionUnsupportedOperationException, FileAlreadyExistsException,
            IOException, SecurityException;
    SeekableByteChannel newByteChannelfinal Path path,
                                        final Set<? extends OpenOption> options,
                                        final FileAttribute<?>... attrs )
            throws IllegalArgumentExceptionUnsupportedOperationException, FileAlreadyExistsException,
            IOException, SecurityException;
    DirectoryStream<Path> newDirectoryStreamfinal Path dir )
            throws IllegalArgumentException, NotDirectoryException, IOException, SecurityException;
    DirectoryStream<Path> newDirectoryStream( final Path dir,
                                              final DirectoryStream.Filter<Path> filter )
            throws IllegalArgumentException, NotDirectoryException, IOException, SecurityException;
    Path createFilefinal Path path,
                     final FileAttribute<?>... attrs )
            FileAlreadyExistsException, IOException, SecurityException;
    Path createDirectoryfinal Path dir,
                          final FileAttribute<?>... attrs )
            FileAlreadyExistsException, IOException, SecurityException;
    Path createDirectoriesfinal Path dir,
                            final FileAttribute<?>... attrs )
            throws UnsupportedOperationException, FileAlreadyExistsException,
            IOException, SecurityException;
    Path createDirectoryfinal Path dir,
                          final Map<String, ?> attrs )
            FileAlreadyExistsException, IOException, SecurityException;
    Path createDirectoriesfinal Path dir,
                            final Map<String, ?> attrs )
            throws UnsupportedOperationException, FileAlreadyExistsException,
            IOException, SecurityException;
    void deletefinal Path path,
                 final DeleteOption... options )
            throws IllegalArgumentException, NoSuchFileException,
            DirectoryNotEmptyException, IOException, SecurityException;
    boolean deleteIfExistsfinal Path path,
                            final DeleteOption... options )
            throws IllegalArgumentException, DirectoryNotEmptyException,
            IOException, SecurityException;
    Path createTempFilefinal String prefix,
                         final String suffix,
                         final FileAttribute<?>... attrs )
            IOException, SecurityException;
    Path createTempFilefinal Path dir,
                         final String prefix,
                         final String suffix,
                         final FileAttribute<?>... attrs )
            IOException, SecurityException;
    Path createTempDirectoryfinal String prefix,
                              final FileAttribute<?>... attrs )
            IOException, SecurityException;
    Path createTempDirectoryfinal Path dir,
                              final String prefix,
                              final FileAttribute<?>... attrs )
            IOException, SecurityException;
    Path copyfinal Path source,
               final Path target,
               final CopyOption... options )
            throws UnsupportedOperationException, FileAlreadyExistsException,
            DirectoryNotEmptyException, IOException, SecurityException;
    Path movefinal Path source,
               final Path target,
               final CopyOption... options )
            throws UnsupportedOperationException, FileAlreadyExistsException,
            DirectoryNotEmptyException, AtomicMoveNotSupportedException,
            IOException, SecurityException;
    <V extends FileAttributeView> V getFileAttributeViewfinal Path path,
                                                          final Class<V> type )
            throws IllegalArgumentException;
    Map<StringObjectreadAttributesfinal Path path )
            throws UnsupportedOperationException, NoSuchFileException,
            IllegalArgumentException, IOException, SecurityException;
    Map<StringObjectreadAttributesfinal Path path,
                                        final String attributes )
            throws UnsupportedOperationException, NoSuchFileException,
            IllegalArgumentException, IOException, SecurityException;
    Path setAttributesfinal Path path,
                        final FileAttribute<?>... attrs )
            ClassCastException, IOException, SecurityException;
    Path setAttributesfinal Path path,
                        final Map<StringObjectattrs )
            ClassCastException, IOException, SecurityException;
    Path setAttributefinal Path path,
                       final String attribute,
                       final Object value )
            ClassCastException, IOException, SecurityException;
    Object getAttributefinal Path path,
                         final String attribute )
            IOException, SecurityException;
    FileTime getLastModifiedTimefinal Path path )
            throws IllegalArgumentException, IOException, SecurityException;
    long sizefinal Path path )
            throws IllegalArgumentException, IOException, SecurityException;
    boolean existsfinal Path path )
            throws IllegalArgumentExceptionSecurityException;
    boolean notExistsfinal Path path )
            throws IllegalArgumentExceptionSecurityException;
    boolean isSameFilefinal Path path,
                        final Path path2 )
            throws IllegalArgumentException, IOException, SecurityException;
    BufferedReader newBufferedReaderfinal Path path,
                                      final Charset cs )
            throws IllegalArgumentException, NoSuchFileException, IOException, SecurityException;
    BufferedWriter newBufferedWriterfinal Path path,
                                      final Charset cs,
                                      final OpenOption... options )
            throws IllegalArgumentException, IOException, UnsupportedOperationExceptionSecurityException;
    long copyfinal InputStream in,
               final Path target,
               final CopyOption... options )
            throws IOException, FileAlreadyExistsException, DirectoryNotEmptyException,
    long copyfinal Path source,
               final OutputStream out )
            throws IOException, SecurityException;
    byte[] readAllBytesfinal Path path )
            throws IOException, OutOfMemoryErrorSecurityException;
    List<StringreadAllLinesfinal Path path )
            throws IllegalArgumentException, NoSuchFileException, IOException, SecurityException;
    List<StringreadAllLinesfinal Path path,
                               final Charset cs )
            throws IllegalArgumentException, NoSuchFileException, IOException, SecurityException;
    String readAllStringfinal Path path,
                          final Charset cs )
            throws IllegalArgumentException, NoSuchFileException, IOException;
    String readAllStringfinal Path path )
            throws IllegalArgumentException, NoSuchFileException, IOException;
    Path writefinal Path path,
                final byte[] bytes,
                final OpenOption... options )
            throws IOException, UnsupportedOperationExceptionSecurityException;
    Path writefinal Path path,
                final byte[] bytes,
                final Map<String, ?> attrs,
                final OpenOption... options )
            throws IOException, UnsupportedOperationExceptionSecurityException;
    Path writefinal Path path,
                final byte[] bytes,
                final Set<? extends OpenOption> options,
                final FileAttribute<?>... attrs )
            throws IllegalArgumentException, IOException, UnsupportedOperationException;
    Path writefinal Path path,
                final Iterable<? extends CharSequencelines,
                final Charset cs,
                final OpenOption... options )
            throws IllegalArgumentException, IOException, UnsupportedOperationExceptionSecurityException;
    Path writefinal Path path,
                final String content,
                final OpenOption... options )
            throws IllegalArgumentException, IOException, UnsupportedOperationException;
    Path writefinal Path path,
                final String content,
                final Charset cs,
                final OpenOption... options )
            throws IllegalArgumentException, IOException, UnsupportedOperationException;
    Path writefinal Path path,
                final String content,
                final Set<? extends OpenOption> options,
                final FileAttribute<?>... attrs )
            throws IllegalArgumentException, IOException, UnsupportedOperationException;
    Path writefinal Path path,
                final String content,
                final Charset cs,
                final Set<? extends OpenOption> options,
                final FileAttribute<?>... attrs )
            throws IllegalArgumentException, IOException, UnsupportedOperationException;
    Path writefinal Path path,
                final String content,
                final Map<String, ?> attrs,
                final OpenOption... options )
            throws IllegalArgumentException, IOException, UnsupportedOperationException;
    Path writefinal Path path,
                final String content,
                final Charset cs,
                final Map<String, ?> attrs,
                final OpenOption... options )
            throws IllegalArgumentException, IOException, UnsupportedOperationException;
    public abstract static class NewFileSystemListener {
        public abstract void executefinal FileSystem newFileSystem,
                                      final String scheme,
                                      final String name,
                                      final Map<String, ?> env );
    }
New to GrepCode? Check out our FAQ X