org.sonatype.aether.impl.internal
Class DefaultFileProcessor

java.lang.Object
  extended by org.sonatype.aether.impl.internal.DefaultFileProcessor
All Implemented Interfaces:
FileProcessor

@Component(role=org.sonatype.aether.spi.io.FileProcessor.class)
public class DefaultFileProcessor
extends Object
implements FileProcessor

A utility class helping with file-based operations.

Author:
Benjamin Hanzelmann, Benjamin Bentmann

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.sonatype.aether.spi.io.FileProcessor
FileProcessor.ProgressListener
 
Constructor Summary
DefaultFileProcessor()
           
 
Method Summary
 long copy(File source, File target, FileProcessor.ProgressListener listener)
           
 boolean mkdirs(File directory)
          Thread-safe variant of File.mkdirs().
 void move(File source, File target)
           
 void write(File file, String data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFileProcessor

public DefaultFileProcessor()
Method Detail

mkdirs

public boolean mkdirs(File directory)
Thread-safe variant of File.mkdirs(). Adapted from Java 6. Creates the directory named by the given abstract pathname, including any necessary but nonexistent parent directories. Note that if this operation fails it may have succeeded in creating some of the necessary parent directories.

Specified by:
mkdirs in interface FileProcessor
Parameters:
directory - The directory to create, may be null.
Returns:
true if and only if the directory was created, along with all necessary parent directories; false otherwise

write

public void write(File file,
                  String data)
           throws IOException
Specified by:
write in interface FileProcessor
Throws:
IOException

copy

public long copy(File source,
                 File target,
                 FileProcessor.ProgressListener listener)
          throws IOException
Specified by:
copy in interface FileProcessor
Throws:
IOException

move

public void move(File source,
                 File target)
          throws IOException
Specified by:
move in interface FileProcessor
Throws:
IOException


Copyright © 2010-2011 Sonatype, Inc.. All Rights Reserved.