|
|||||||||
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 java.lang.String |
location
|
protected Project |
projectObj
|
protected java.io.File |
tempFile
|
Constructor Summary | |
---|---|
ProjectFile()
|
|
ProjectFile(Project project,
java.lang.String location)
Constructor for ProjectFile. |
Method Summary | |
---|---|
abstract boolean |
canHandle(java.lang.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(java.io.File file)
|
java.lang.String |
getLocation()
Builds a filename from the object name and "file suffix". |
java.lang.String |
getLocationSuffix()
Returns suffix to append to object name when creating a file name. |
abstract java.lang.Object |
getObject()
Returns a project object associated with this file. |
abstract java.lang.String |
getObjectName()
Returns a name of associated object, that is also used as a file name. |
java.lang.String |
getOldLocation()
Returns saved location of a file. |
Project |
getProject()
Returns the project. |
boolean |
isRenamed()
|
java.io.File |
resolveFile()
Returns a file which is a canonical representation of the file to store a wrapped object. |
java.io.File |
resolveOldFile()
Returns a file which is a canonical representation of the file to store a wrapped object. |
abstract void |
save(java.io.PrintWriter out)
Saves an underlying object to the file. |
java.io.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 java.io.File |
tempFileForFile(java.io.File f)
Creates a temporary file for the master file. |
java.lang.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 java.lang.String location
protected java.io.File tempFile
protected Project projectObj
Constructor Detail |
---|
public ProjectFile()
public ProjectFile(Project project, java.lang.String location)
Method Detail |
---|
public java.lang.String getLocation()
public java.lang.String getOldLocation()
public java.lang.String getLocationSuffix()
public abstract java.lang.Object getObject()
public abstract java.lang.String getObjectName()
public abstract void save(java.io.PrintWriter out) throws java.lang.Exception
java.lang.Exception
public abstract boolean canHandle(java.lang.Object obj)
public boolean canHandleObject()
public void synchronizeLocation()
public void willSave()
public void saveTemp() throws java.lang.Exception
java.lang.Exception
public java.io.File resolveFile()
public java.io.File resolveOldFile()
public java.io.File saveCommit() throws ProjectException
ProjectException
public void saveUndo()
public Project getProject()
public boolean isRenamed()
protected java.io.File tempFileForFile(java.io.File f) throws java.io.IOException
java.io.IOException
protected void checkWritePermissions(java.io.File file) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |