<?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 Create directories if not exist Nuxeo in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/create-directories-if-not-exist-nuxeo/m-p/316866#M3867</link>
    <description>&lt;P&gt;I am attempting to do a document.copy on an existing document, with the assumption that if the directories I am copying into may or may not exist. What would be a good way to achieve that?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; client = new nuxeo.Client(nuxeoParams)
 client.connect()
 copyOp = client.operation("Document.Copy")
 path = "doc:#{devConfig.path}#{devConfig.username}/#{devConfig.env}"/file.title
 var copyParams =
      { target: "doc:#{devConfig.path}#{devConfig.username}/#{devConfig.env}/documents/#{documentId}/" }
 copyOp.input(path).params(copyParams)
 copyOp.execute(function(error, data){
 if(error){
    console.debug('error')
 }else{
    console.debug('data')
 }
})
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This 404s. What would be a way to avoid this and create the directories necessary in a lazy manner?&lt;/P&gt;</description>
    <pubDate>Mon, 05 May 2014 19:47:13 GMT</pubDate>
    <dc:creator>abe_</dc:creator>
    <dc:date>2014-05-05T19:47:13Z</dc:date>
    <item>
      <title>Create directories if not exist Nuxeo</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/create-directories-if-not-exist-nuxeo/m-p/316866#M3867</link>
      <description>&lt;P&gt;I am attempting to do a document.copy on an existing document, with the assumption that if the directories I am copying into may or may not exist. What would be a good way to achieve that?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; client = new nuxeo.Client(nuxeoParams)
 client.connect()
 copyOp = client.operation("Document.Copy")
 path = "doc:#{devConfig.path}#{devConfig.username}/#{devConfig.env}"/file.title
 var copyParams =
      { target: "doc:#{devConfig.path}#{devConfig.username}/#{devConfig.env}/documents/#{documentId}/" }
 copyOp.input(path).params(copyParams)
 copyOp.execute(function(error, data){
 if(error){
    console.debug('error')
 }else{
    console.debug('data')
 }
})
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This 404s. What would be a way to avoid this and create the directories necessary in a lazy manner?&lt;/P&gt;</description>
      <pubDate>Mon, 05 May 2014 19:47:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/create-directories-if-not-exist-nuxeo/m-p/316866#M3867</guid>
      <dc:creator>abe_</dc:creator>
      <dc:date>2014-05-05T19:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Create directories if not exist Nuxeo</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/create-directories-if-not-exist-nuxeo/m-p/316867#M3868</link>
      <description>&lt;P&gt;I ended up catching the 404s and creating the directories as needed. It was pretty verbose, so I'd welcome anyone showing a better way.&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2014 20:44:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/create-directories-if-not-exist-nuxeo/m-p/316867#M3868</guid>
      <dc:creator>Steven_Huwig1</dc:creator>
      <dc:date>2014-05-06T20:44:11Z</dc:date>
    </item>
  </channel>
</rss>

