com.googlecode.jpattern.core.textfiles.local
Class LocalResource

java.lang.Object
  extended by com.googlecode.jpattern.core.textfiles.local.LocalResource
All Implemented Interfaces:
IResource, Serializable

public class LocalResource
extends Object
implements IResource

Author:
Francesco Cina' 10/mag/2010
See Also:
Serialized Form

Constructor Summary
LocalResource(String path, CharacterEncoding defaultEncodingCharset)
           
 
Method Summary
 IFile create(String filename, String text)
           
 IFile create(String filename, String text, CharacterEncoding encodingCharset)
           
 boolean delete(String filename)
           
 IFile getFile(String filename)
           
 IFile getFile(String filename, CharacterEncoding encodingCharset)
           
 List<String> getFilenames()
           
 String getName()
           
 String getPath()
           
 boolean isValid()
           
 boolean rename(String filename, String newFilename)
           
protected  void write(File file, String text)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalResource

public LocalResource(String path,
                     CharacterEncoding defaultEncodingCharset)
Method Detail

delete

public boolean delete(String filename)
Specified by:
delete in interface IResource

getFile

public IFile getFile(String filename,
                     CharacterEncoding encodingCharset)
Specified by:
getFile in interface IResource

getFile

public IFile getFile(String filename)
Specified by:
getFile in interface IResource

create

public IFile create(String filename,
                    String text)
             throws Exception
Specified by:
create in interface IResource
Throws:
Exception

create

public IFile create(String filename,
                    String text,
                    CharacterEncoding encodingCharset)
             throws IOException
Specified by:
create in interface IResource
Throws:
IOException

getFilenames

public List<String> getFilenames()
Specified by:
getFilenames in interface IResource

write

protected void write(File file,
                     String text)
              throws IOException
Throws:
IOException

isValid

public boolean isValid()
Specified by:
isValid in interface IResource

getName

public String getName()
Specified by:
getName in interface IResource

getPath

public String getPath()
Specified by:
getPath in interface IResource

rename

public boolean rename(String filename,
                      String newFilename)
Specified by:
rename in interface IResource


Copyright © 2011. All Rights Reserved.