[opencms-dev] manual backup of resources
Florian Kleedorfer
florian.kleedorfer at austria.fm
Mon Apr 19 20:39:01 CEST 2004
hi all!
Does anyone know how you can "manually" backup a single CmsResource
without publishing it and without having to backup the whole project?
Here's a sketch of the lifecycle that I would like to implement:
[creation]
public void CreateFile(CmsObject cms, String filename, byte[]
myModifiedByteContent) {
...
CmsResource newResource = cms.createResource( folder, name ,
"plain", null, myNewByteContent);
...
}
[manipulation]
public void manipulateFile(CmsObject cms, String filename, byte[]
myModifiedByteContent) {
...
CmsFile file = cms.readFile(filename);
<backup the CmsResource (i.e. the CmsFile), need help here!>
file.setContents(myModifiedByteContent);
cms.writeFile(file);
...
}
[restoring]
public void restoreVersion(CmsObject cms, String filename, int versionId) {
<need help here!>
}
thx for your help!
flo
More information about the opencms-dev
mailing list