<?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 Re: File whitelisting / blacklisting with ndrive in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/file-whitelisting-blacklisting-with-ndrive/m-p/327443#M14444</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Server-side&lt;/STRONG&gt; you can override the &lt;CODE&gt;defaultFileSystemItemFactory&lt;/CODE&gt; contribution to the &lt;CODE&gt;fileSystemItemFactory&lt;/CODE&gt; extension point with a Java class extending &lt;CODE&gt;DefaultFileSystemItemFactory&lt;/CODE&gt; and overriding &lt;CODE&gt;isFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint)&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;By default we only check if the document is folderish or holds a blob. You could add a filter on the mime-type to return false (meaning the file won't be synchronized) in the case of a .pdf file for example.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;// Check Folderish or BlobHolder with a blob
if (!doc.isFolder() &amp;amp;&amp;amp; !hasBlob(doc)) {
   log.debug(String.format(
       "Document %s is not Folderish nor a BlobHolder with a blob, it cannot be adapted as a FileSystemItem.", doc.getId()));
    return false;
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Client-side&lt;/STRONG&gt;, unfortunately for now the blacklisted extensions are hardcoded in &lt;A href="https://github.com/nuxeo/nuxeo-drive/blob/master/nuxeo-drive-client/nxdrive/client/common.py"&gt;nuxeo-drive-client/nxdrive/client/common.py&lt;/A&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;DEFAULT_IGNORED_SUFFIXES = [
    '~',  # editor buffers
    '.swp',  # vim swap files
    '.lock',  # some process use file locks
    '.LOCK',  # other locks
    '.part',  # partially downloaded files
]
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So if you want to always blacklist .pdf files for example you will need to add this extension to the ignored suffixes and build the client, see &lt;A href="https://github.com/nuxeo/nuxeo-drive/blob/master/DEVELOPERS.rst"&gt;contributor guide&lt;/A&gt; for instructions.&lt;/P&gt;
&lt;P&gt;We are planning to allow customization of the file suffixes to ignore in a local configuration file, see related JIRA issue &lt;A href="https://jira.nuxeo.com/browse/NXP-13219"&gt;NXP-13219&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jan 2014 11:10:30 GMT</pubDate>
    <dc:creator>ataillefer_</dc:creator>
    <dc:date>2014-01-08T11:10:30Z</dc:date>
    <item>
      <title>File whitelisting / blacklisting with ndrive</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/file-whitelisting-blacklisting-with-ndrive/m-p/327442#M14443</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I know that the nuxeo sync client ndrive is a relatively new thing. Is there a possibillity to limit the file types thet are synced from the folder? So that I can keep e.g. the pdf's in the same folder as the Office documents but only the Office documents are synced. Would be also useful to keep raw and jpeg images in the same folder but only sync the smaller jpgs.&lt;/P&gt;
&lt;P&gt;Is there any type of file sync filtering?&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 02:54:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/file-whitelisting-blacklisting-with-ndrive/m-p/327442#M14443</guid>
      <dc:creator>hgret_</dc:creator>
      <dc:date>2014-01-08T02:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: File whitelisting / blacklisting with ndrive</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/file-whitelisting-blacklisting-with-ndrive/m-p/327443#M14444</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Server-side&lt;/STRONG&gt; you can override the &lt;CODE&gt;defaultFileSystemItemFactory&lt;/CODE&gt; contribution to the &lt;CODE&gt;fileSystemItemFactory&lt;/CODE&gt; extension point with a Java class extending &lt;CODE&gt;DefaultFileSystemItemFactory&lt;/CODE&gt; and overriding &lt;CODE&gt;isFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint)&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;By default we only check if the document is folderish or holds a blob. You could add a filter on the mime-type to return false (meaning the file won't be synchronized) in the case of a .pdf file for example.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;// Check Folderish or BlobHolder with a blob
if (!doc.isFolder() &amp;amp;&amp;amp; !hasBlob(doc)) {
   log.debug(String.format(
       "Document %s is not Folderish nor a BlobHolder with a blob, it cannot be adapted as a FileSystemItem.", doc.getId()));
    return false;
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Client-side&lt;/STRONG&gt;, unfortunately for now the blacklisted extensions are hardcoded in &lt;A href="https://github.com/nuxeo/nuxeo-drive/blob/master/nuxeo-drive-client/nxdrive/client/common.py"&gt;nuxeo-drive-client/nxdrive/client/common.py&lt;/A&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;DEFAULT_IGNORED_SUFFIXES = [
    '~',  # editor buffers
    '.swp',  # vim swap files
    '.lock',  # some process use file locks
    '.LOCK',  # other locks
    '.part',  # partially downloaded files
]
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So if you want to always blacklist .pdf files for example you will need to add this extension to the ignored suffixes and build the client, see &lt;A href="https://github.com/nuxeo/nuxeo-drive/blob/master/DEVELOPERS.rst"&gt;contributor guide&lt;/A&gt; for instructions.&lt;/P&gt;
&lt;P&gt;We are planning to allow customization of the file suffixes to ignore in a local configuration file, see related JIRA issue &lt;A href="https://jira.nuxeo.com/browse/NXP-13219"&gt;NXP-13219&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 11:10:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/file-whitelisting-blacklisting-with-ndrive/m-p/327443#M14444</guid>
      <dc:creator>ataillefer_</dc:creator>
      <dc:date>2014-01-08T11:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: File whitelisting / blacklisting with ndrive</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/file-whitelisting-blacklisting-with-ndrive/m-p/327444#M14445</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 16:17:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/file-whitelisting-blacklisting-with-ndrive/m-p/327444#M14445</guid>
      <dc:creator>hgret_</dc:creator>
      <dc:date>2014-01-08T16:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: File whitelisting / blacklisting with ndrive</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/file-whitelisting-blacklisting-with-ndrive/m-p/327445#M14446</link>
      <description>&lt;P&gt;Yes blacklisting only client-side.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2014 10:48:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/file-whitelisting-blacklisting-with-ndrive/m-p/327445#M14446</guid>
      <dc:creator>ataillefer_</dc:creator>
      <dc:date>2014-01-13T10:48:53Z</dc:date>
    </item>
  </channel>
</rss>

