mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Fairly complete test coverage of basic sanity type operations: createFile, createDirectory,
createBranch, createLayeredDirectory, createLayeredFile, rename, delete, read, write, snapshot, listDirectory. Rename, createLayeredDirectory, createBranch all tested across repositories also. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@2940 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -62,7 +62,7 @@ public class LayeredFileNode extends FileNode implements Layered
|
||||
fData =
|
||||
new LayeredFileNodeBeanImpl(repo.getSuperRepository().issueID(),
|
||||
-1,
|
||||
-1L,
|
||||
0L,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
@@ -99,7 +99,7 @@ public class LayeredFileNode extends FileNode implements Layered
|
||||
fData =
|
||||
new LayeredFileNodeBeanImpl(repos.getSuperRepository().issueID(),
|
||||
-1,
|
||||
-1L,
|
||||
0L,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
@@ -126,7 +126,7 @@ public class LayeredFileNode extends FileNode implements Layered
|
||||
time);
|
||||
fData = new LayeredFileNodeBeanImpl(repo.getSuperRepository().issueID(),
|
||||
-1,
|
||||
-1L,
|
||||
0L,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
@@ -151,10 +151,16 @@ public class LayeredFileNode extends FileNode implements Layered
|
||||
*/
|
||||
public AVMNode possiblyCopy(Lookup lPath)
|
||||
{
|
||||
// LayeredFileNodes are always copied.
|
||||
// TODO This is busted. Need to set the PlainFileNode contents
|
||||
// to share with underlying file node.
|
||||
PlainFileNode newMe = new PlainFileNode(lPath.getRepository());
|
||||
Lookup lookup = lPath.getRepository().getSuperRepository().lookup(-1, fData.getIndirection());
|
||||
AVMNode indirect = lookup.getCurrentNode();
|
||||
if (!(indirect instanceof FileNode))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unbacked layered file node.");
|
||||
}
|
||||
// This is a mildly dirty trick. We use getContentForRead so as not to startle
|
||||
// the ultimate destination content into copying itself prematurely.
|
||||
FileContent content = ((FileNode)indirect).getContentForRead(-1, lPath.getRepository());
|
||||
PlainFileNode newMe = new PlainFileNode(content, lPath.getRepository(), fData.getBasicAttributes());
|
||||
newMe.setAncestor(this);
|
||||
return newMe;
|
||||
}
|
||||
|
Reference in New Issue
Block a user