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.impl;
 
 import java.util.Map;
 import java.util.Set;
 
 import  org.uberfire.commons.lock.LockService;
 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.FileAlreadyExistsException;
 import  org.uberfire.java.nio.file.Files;
 import  org.uberfire.java.nio.file.NoSuchFileException;
 import  org.uberfire.java.nio.file.OpenOption;
 import  org.uberfire.java.nio.file.Path;
 import  org.uberfire.java.nio.file.attribute.FileAttribute;
 import  org.uberfire.java.nio.file.attribute.FileAttributeView;
 
         extends AbstractIOService
         implements IOService {
 
     public IOServiceNio2WrapperImpl() {
         super();
     }
 
     public IOServiceNio2WrapperImplfinal String id ) {
         superid );
     }
 
     public IOServiceNio2WrapperImplfinal IOWatchService watchService ) {
         superwatchService );
     }
 
     public IOServiceNio2WrapperImplfinal String id,
                                      final IOWatchService watchService ) {
         superidwatchService );
     }
 
     public IOServiceNio2WrapperImplfinal LockService lockService,
                                      final IOWatchService watchService ) {
         superlockServicewatchService );
     }
 
     public IOServiceNio2WrapperImplfinal String id,
                                      final LockService lockService,
                                      final IOWatchService watchService ) {
         superidlockServicewatchService );
     }
 
     @Override
     public void deletefinal Path path,
                         final DeleteOption... options )
             throws IllegalArgumentException, NoSuchFileException, DirectoryNotEmptyException,
             IOException, SecurityException {
         Files.delete( pathoptions );
     }
 
     @Override
     public boolean deleteIfExistsfinal Path path,
                                    final DeleteOption... options )
             throws IllegalArgumentException, DirectoryNotEmptyException, IOException, SecurityException {
         return Files.deleteIfExists( pathoptions );
     }
 
     @Override
     public SeekableByteChannel newByteChannelfinal Path path,
                                                final Set<? extends OpenOption> options,
                                                final FileAttribute<?>... attrs )
             throws IllegalArgumentExceptionUnsupportedOperationException, FileAlreadyExistsException, IOException, SecurityException {
         return Files.newByteChannel( pathoptionsattrs );
     }
 
     @Override
     public Path createDirectoryfinal Path dir,
                                  final FileAttribute<?>... attrs )
             throws IllegalArgumentExceptionUnsupportedOperationException, FileAlreadyExistsException,
             IOException, SecurityException {
        return Files.createDirectory( dirattrs );
    }
    @Override
    public Path createDirectoriesfinal Path dir,
                                   final FileAttribute<?>... attrs )
            throws UnsupportedOperationException, FileAlreadyExistsException,
            IOException, SecurityException {
        return Files.createDirectories( dirattrs );
    }
    @Override
    public Path copyfinal Path source,
                      final Path target,
                      final CopyOption... options )
            throws UnsupportedOperationException, FileAlreadyExistsException,
            DirectoryNotEmptyException, IOException, SecurityException {
        return Files.copy( sourcetargetoptions );
    }
    @Override
    public Path movefinal Path source,
                      final Path target,
                      final CopyOption... options )
            throws UnsupportedOperationException, FileAlreadyExistsException,
            DirectoryNotEmptyException, AtomicMoveNotSupportedException, IOException, SecurityException {
        return Files.move( sourcetargetoptions );
    }
    @Override
    public <V extends FileAttributeView> V getFileAttributeViewfinal Path path,
                                                                 final Class<V> type )
            throws IllegalArgumentException {
        return Files.getFileAttributeView( pathtype );
    }
    @Override
    public Map<StringObjectreadAttributesfinal Path path,
                                               final String attributes )
            throws UnsupportedOperationException, NoSuchFileException, IllegalArgumentException,
            IOException, SecurityException {
        return Files.readAttributes( pathattributes );
    }
    @Override
    public Path setAttributesfinal Path path,
                               final FileAttribute<?>... attrs )
            IOException, SecurityException {
        Path out = null;
        for ( final FileAttribute<?> attr : attrs ) {
            out = Files.setAttribute( pathattr.name(), attr.value() );
        }
        return out;
    }
    @Override
    public Object getAttributefinal Path path,
                                final String attribute )
            throws UnsupportedOperationExceptionIllegalArgumentException, IOException, SecurityException {
        return Files.getAttribute( pathattribute );
    }
    @Override
    protected Set<? extends OpenOption> buildOptionsfinal Set<? extends OpenOption> options,
                                                      final OpenOption... others ) {
        return new HashSet<OpenOption>( options ) {{
            if ( others != null ) {
                for ( final OpenOption other : others ) {
                    addother );
                }
            }
        }};
    }
New to GrepCode? Check out our FAQ X