org.codehaus.mojo.mrm.impl
Class CompositeFileSystem

java.lang.Object
  extended by org.codehaus.mojo.mrm.impl.CompositeFileSystem
All Implemented Interfaces:
Serializable, org.codehaus.mojo.mrm.api.FileSystem

public class CompositeFileSystem
extends Object
implements org.codehaus.mojo.mrm.api.FileSystem

A file system that is a composite of multiple file systems.

Since:
1.0
See Also:
Serialized Form

Constructor Summary
CompositeFileSystem(org.codehaus.mojo.mrm.api.FileSystem[] delegates)
          Creates a new FileSystem that will delegate to each of the supplied delegate FileSystem in turn until a matching entry is found.
 
Method Summary
 org.codehaus.mojo.mrm.api.Entry get(String path)
          
 long getLastModified(org.codehaus.mojo.mrm.api.DirectoryEntry entry)
          
 org.codehaus.mojo.mrm.api.DirectoryEntry getRoot()
          
 org.codehaus.mojo.mrm.api.Entry[] listEntries(org.codehaus.mojo.mrm.api.DirectoryEntry directory)
          
 org.codehaus.mojo.mrm.api.DirectoryEntry mkdir(org.codehaus.mojo.mrm.api.DirectoryEntry parent, String name)
          
 org.codehaus.mojo.mrm.api.FileEntry put(org.codehaus.mojo.mrm.api.DirectoryEntry parent, String name, byte[] content)
          
 org.codehaus.mojo.mrm.api.FileEntry put(org.codehaus.mojo.mrm.api.DirectoryEntry parent, String name, InputStream content)
          
 void remove(org.codehaus.mojo.mrm.api.Entry entry)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeFileSystem

public CompositeFileSystem(org.codehaus.mojo.mrm.api.FileSystem[] delegates)
Creates a new FileSystem that will delegate to each of the supplied delegate FileSystem in turn until a matching entry is found.

Parameters:
delegates - the delegate FileSystems (in order of preference).
Method Detail

listEntries

public org.codehaus.mojo.mrm.api.Entry[] listEntries(org.codehaus.mojo.mrm.api.DirectoryEntry directory)

Specified by:
listEntries in interface org.codehaus.mojo.mrm.api.FileSystem

get

public org.codehaus.mojo.mrm.api.Entry get(String path)

Specified by:
get in interface org.codehaus.mojo.mrm.api.FileSystem

getLastModified

public long getLastModified(org.codehaus.mojo.mrm.api.DirectoryEntry entry)
                     throws IOException

Specified by:
getLastModified in interface org.codehaus.mojo.mrm.api.FileSystem
Throws:
IOException

getRoot

public org.codehaus.mojo.mrm.api.DirectoryEntry getRoot()

Specified by:
getRoot in interface org.codehaus.mojo.mrm.api.FileSystem

mkdir

public org.codehaus.mojo.mrm.api.DirectoryEntry mkdir(org.codehaus.mojo.mrm.api.DirectoryEntry parent,
                                                      String name)

Specified by:
mkdir in interface org.codehaus.mojo.mrm.api.FileSystem

put

public org.codehaus.mojo.mrm.api.FileEntry put(org.codehaus.mojo.mrm.api.DirectoryEntry parent,
                                               String name,
                                               InputStream content)
                                        throws IOException

Specified by:
put in interface org.codehaus.mojo.mrm.api.FileSystem
Throws:
IOException

put

public org.codehaus.mojo.mrm.api.FileEntry put(org.codehaus.mojo.mrm.api.DirectoryEntry parent,
                                               String name,
                                               byte[] content)
                                        throws IOException

Specified by:
put in interface org.codehaus.mojo.mrm.api.FileSystem
Throws:
IOException

remove

public void remove(org.codehaus.mojo.mrm.api.Entry entry)

Specified by:
remove in interface org.codehaus.mojo.mrm.api.FileSystem


Copyright © 2009-2011 Codehaus. All Rights Reserved.