<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic CMIS: save files with the same name in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/cmis-save-files-with-the-same-name/m-p/59213#M20995</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good day.&lt;/P&gt;&lt;P&gt;I create a document in Alfresco using CMIS. Code:&lt;/P&gt;&lt;P&gt;Session session = ...&lt;/P&gt;&lt;P&gt;Folder parent = session.getRootFolder ();&lt;/P&gt;&lt;P&gt;String textFileName = "test.txt"; // prepare content - a simple text file&lt;/P&gt;&lt;P&gt;String content = "Hello World!";&lt;/P&gt;&lt;P&gt;String filename = textFileName;&lt;/P&gt;&lt;P&gt;String mimetype = "text / plain; charset = UTF-8";&lt;/P&gt;&lt;P&gt;byte [] contentBytes = content.getBytes ("UTF-8");&lt;/P&gt;&lt;P&gt;ByteArrayInputStream stream = new ByteArrayInputStream (contentBytes);&lt;/P&gt;&lt;P&gt;ContentStream contentStream = session.getObjectFactory (). CreateContentStream (filename, contentBytes.length, mimetype, stream); // prepare properties&lt;/P&gt;&lt;P&gt;Map &amp;lt;String, Object&amp;gt; properties = new HashMap &amp;lt;String, Object&amp;gt; ();&lt;/P&gt;&lt;P&gt;properties.put (PropertyIds.NAME, textFileName);&lt;/P&gt;&lt;P&gt;properties.put (PropertyIds.OBJECT_TYPE_ID, "cmis: document"); // create the document&lt;/P&gt;&lt;P&gt;Document newDoc = parent.createDocument (properties, contentStream, VersioningState.MAJOR);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I save a file with the same name twice, I get a CmisContentAlreadyExistsException.&lt;BR /&gt;When I add files with the same name through Alfresco, suffixes are added to the file names (as file_name-1, file_name-2 ...). Is it possible to save files with the same name via CMIS?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Feb 2019 18:57:34 GMT</pubDate>
    <dc:creator>viktoriyamoskov</dc:creator>
    <dc:date>2019-02-19T18:57:34Z</dc:date>
    <item>
      <title>CMIS: save files with the same name</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cmis-save-files-with-the-same-name/m-p/59213#M20995</link>
      <description>Good day.I create a document in Alfresco using CMIS. Code&lt;IMG id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://migration33.stage.lithium.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;ession session = ...Folder parent = session.getRootFolder ();String textFileName = "test.txt"; // prepare content - a simple text fileString content = "Hello World!";String filename = textFileName;String mimetype = "text / plain; charset = U</description>
      <pubDate>Tue, 19 Feb 2019 18:57:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cmis-save-files-with-the-same-name/m-p/59213#M20995</guid>
      <dc:creator>viktoriyamoskov</dc:creator>
      <dc:date>2019-02-19T18:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: CMIS: save files with the same name</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cmis-save-files-with-the-same-name/m-p/59214#M20996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My recollection is that the renaming is done by the UI by catching the exception, and updating the name until that exception is not thrown.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2019 15:36:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cmis-save-files-with-the-same-name/m-p/59214#M20996</guid>
      <dc:creator>binduwavell</dc:creator>
      <dc:date>2019-02-21T15:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: CMIS: save files with the same name</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cmis-save-files-with-the-same-name/m-p/59215#M20997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply.&lt;BR /&gt;As I understand it, CMIS does not contain functionality for renaming files with the same name?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2019 04:46:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cmis-save-files-with-the-same-name/m-p/59215#M20997</guid>
      <dc:creator>viktoriyamoskov</dc:creator>
      <dc:date>2019-02-26T04:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: CMIS: save files with the same name</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cmis-save-files-with-the-same-name/m-p/59216#M20998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right, if you want renaming, you have to implement it in your code that is using CMIS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2019 16:18:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cmis-save-files-with-the-same-name/m-p/59216#M20998</guid>
      <dc:creator>binduwavell</dc:creator>
      <dc:date>2019-02-28T16:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: CMIS: save files with the same name</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cmis-save-files-with-the-same-name/m-p/59217#M20999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2019 17:51:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cmis-save-files-with-the-same-name/m-p/59217#M20999</guid>
      <dc:creator>viktoriyamoskov</dc:creator>
      <dc:date>2019-03-01T17:51:03Z</dc:date>
    </item>
  </channel>
</rss>

