org.codehaus.mojo.mrm.impl
Class DiskFileSystem

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

public class DiskFileSystem
extends org.codehaus.mojo.mrm.api.BaseFileSystem

A file system hosted from a local directory.

Since:
1.0
See Also:
Serialized Form

Constructor Summary
DiskFileSystem(File root)
          Creates a new read-only instance.
DiskFileSystem(File root, boolean readOnly)
          Creates a new instance.
 
Method Summary
 long getLastModified(org.codehaus.mojo.mrm.api.DirectoryEntry entry)
          
 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, InputStream content)
          
 void remove(org.codehaus.mojo.mrm.api.Entry entry)
          
 
Methods inherited from class org.codehaus.mojo.mrm.api.BaseFileSystem
get, get, getRoot, put
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiskFileSystem

public DiskFileSystem(File root,
                      boolean readOnly)
Creates a new instance.

Parameters:
root - the root of the file system.
readOnly - true if the file system is to be read-only
Since:
1.0

DiskFileSystem

public DiskFileSystem(File root)
Creates a new read-only instance.

Parameters:
root - the root of the file system.
Since:
1.0
Method Detail

listEntries

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


getLastModified

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

Throws:
IOException

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
Overrides:
mkdir in class org.codehaus.mojo.mrm.api.BaseFileSystem

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
Overrides:
put in class org.codehaus.mojo.mrm.api.BaseFileSystem
Throws:
IOException

remove

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

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


Copyright © 2009-2011 Codehaus. All Rights Reserved.