replace existing file

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2013 07:38 AM
hi, i am implementing a action , change file to pdf , so there is need , to replace existing file or content and replace with new file
Can anybody help me How it is possible?
Can anybody help me How it is possible?
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2013 02:12 PM
Please read the docs and attempt to overwrite the file on your own. If you have trouble, come back with the stack trace and your source code so we can help you troubleshoot.
If you are doing this remotely and you are using Java, the preferred API is to use CMIS and the docs for that live <a href="http://chemistry.apache.org/java/0.9.0/maven/apidocs/">here</a>.
Jeff
If you are doing this remotely and you are using Java, the preferred API is to use CMIS and the docs for that live <a href="http://chemistry.apache.org/java/0.9.0/maven/apidocs/">here</a>.
Jeff

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2013 01:24 AM
HI, i have a import a pdf,then i want to make it password protected, for this i write a code, Like
parameter.put(SessionParameter.USER, "admin");
parameter.put(SessionParameter.PASSWORD, "admin");
// connection settings
parameter.put(SessionParameter.ATOMPUB_URL, "http://localhost:8080/alfresco/cmisatom");
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
// set the alfresco object factory
parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
// create session
SessionFactory factory = SessionFactoryImpl.newInstance();
Session session = factory.getRepositories(parameter).get(0).createSession();
CmisObject doc= session.getObject(id);
ContentStream contentStream = doc.getContentStream();
InputStream inputStream = null;
inputStream=contentStream .getStream();
File file = new File("C:/savefile.pdf");
// get the PDF input stream and create a reader for iText
PdfReader reader = new PdfReader(inputStream);
stamp = new PdfStamper(reader, new FileOutputStream(file));
// encrypt PDF
stamp.setEncryption(userPassword.getBytes(Charset.forName("UTF-8")), ownerPassword.getBytes(Charset.forName("UTF-8")), permissions, encryptionType);
stamp.close();
Now i want to replace encrypted with existing File,How it is possible?Plz help me
parameter.put(SessionParameter.USER, "admin");
parameter.put(SessionParameter.PASSWORD, "admin");
// connection settings
parameter.put(SessionParameter.ATOMPUB_URL, "http://localhost:8080/alfresco/cmisatom");
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
// set the alfresco object factory
parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
// create session
SessionFactory factory = SessionFactoryImpl.newInstance();
Session session = factory.getRepositories(parameter).get(0).createSession();
CmisObject doc= session.getObject(id);
ContentStream contentStream = doc.getContentStream();
InputStream inputStream = null;
inputStream=contentStream .getStream();
File file = new File("C:/savefile.pdf");
// get the PDF input stream and create a reader for iText
PdfReader reader = new PdfReader(inputStream);
stamp = new PdfStamper(reader, new FileOutputStream(file));
// encrypt PDF
stamp.setEncryption(userPassword.getBytes(Charset.forName("UTF-8")), ownerPassword.getBytes(Charset.forName("UTF-8")), permissions, encryptionType);
stamp.close();
Now i want to replace encrypted with existing File,How it is possible?Plz help me
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2013 05:09 AM
Read Content Management Interoperability Services (CMIS) Specification you 'll find what you need ,you can find Specification here
http://docs.oasis-open.org/cmis/CMIS/v1.1/cs01/CMIS-v1.1-cs01.pdf
http://docs.oasis-open.org/cmis/CMIS/v1.1/cs01/CMIS-v1.1-cs01.pdf
