04-18-2006 10:04 AM
public static Reference copyFile(String file1Path, String file2Name, String file2Folder) throws Exception{
// Get the content service
ContentServiceSoapBindingStub contentService = WebServiceFactory.getContentService();
Reference file1Ref = new Reference(STORE, null, file1Path);
Content[] readResult = contentService.read(
new Predicate(new Reference[]{file1Ref}, STORE, null),
Constants.PROP_CONTENT);
Content content = readResult[0];
//Create new content in the repository
createNewContent(file2Name, ContentUtils.getContentAsString(content),file2Folder);
return content.getNode();
}copyFile("/app:company_home/plop.txt", "file copy.txt", "/app:company_home");with the address of the file in first, the name of the new file in second and to finish the path where to create the copy.05-02-2006 06:50 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.