A new flavor of createFile. Slightly slower. Significantly safer.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3277 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-07-03 16:36:31 +00:00
parent 92a7348a43
commit 37843668a4
9 changed files with 163 additions and 6 deletions

View File

@@ -17,6 +17,7 @@
package org.alfresco.repo.avm;
import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.RandomAccessFile;
@@ -117,6 +118,20 @@ class SuperRepository
return rep.createFile(pathParts[1], name);
}
/**
* Create a file with the given File as content.
* @param path The path to the containing directory.
* @param name The name to give the file.
* @param data The file contents.
*/
public void createFile(String path, String name, File data)
{
fLookupCount.set(1);
String[] pathParts = SplitPath(path);
Repository rep = getRepositoryByName(pathParts[0], true);
rep.createFile(pathParts[1], name, data);
}
/**
* Create a new directory.
* @param path The path to the containing directory.