|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.project.ProjectFile
public abstract class ProjectFile
ProjectFile is an adapter from an object in Cayenne project to its representation in the file system.
Field Summary | |
---|---|
protected String |
location
|
protected Project |
projectObj
|
protected File |
tempFile
|
Constructor Summary | |
---|---|
ProjectFile()
|
|
ProjectFile(Project project,
String location)
Constructor for ProjectFile. |
Method Summary | |
---|---|
abstract boolean |
canHandle(Object obj)
Returns true if this file wrapper can handle a specified object. |
boolean |
canHandleObject()
Returns true if this file wrapper can handle an internally stored object. |
protected void |
checkWritePermissions(File file)
|
String |
getLocation()
Builds a filename from the object name and "file suffix". |
String |
getLocationSuffix()
Returns suffix to append to object name when creating a file name. |
abstract Object |
getObject()
Returns a project object associated with this file. |
abstract String |
getObjectName()
Returns a name of associated object, that is also used as a file name. |
String |
getOldLocation()
Returns saved location of a file. |
Project |
getProject()
Returns the project. |
boolean |
isRenamed()
|
File |
resolveFile()
Returns a file which is a canonical representation of the file to store a wrapped object. |
File |
resolveOldFile()
Returns a file which is a canonical representation of the file to store a wrapped object. |
abstract void |
save(PrintWriter out)
Saves an underlying object to the file. |
File |
saveCommit()
Finishes saving the underlying object. |
void |
saveTemp()
Saves ProjectFile's underlying object to a temporary file, returning this file to the caller. |
void |
saveUndo()
Cleans up after unsuccessful or canceled save attempt. |
void |
synchronizeLocation()
Replaces internally stored filename with the current object name. |
protected File |
tempFileForFile(File f)
Creates a temporary file for the master file. |
String |
toString()
|
void |
willSave()
This method is called by project to let file know that it will be saved. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected String location
protected File tempFile
protected Project projectObj
Constructor Detail |
---|
public ProjectFile()
public ProjectFile(Project project, String location)
Method Detail |
---|
public String getLocation()
public String getOldLocation()
public String getLocationSuffix()
public abstract Object getObject()
public abstract String getObjectName()
public abstract void save(PrintWriter out) throws Exception
Exception
public abstract boolean canHandle(Object obj)
public boolean canHandleObject()
public void synchronizeLocation()
public void willSave()
public void saveTemp() throws Exception
Exception
public File resolveFile()
public File resolveOldFile()
public File saveCommit() throws ProjectException
ProjectException
public void saveUndo()
public Project getProject()
public boolean isRenamed()
protected File tempFileForFile(File f) throws IOException
IOException
protected void checkWritePermissions(File file) throws IOException
IOException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |