<?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: How to get a Site's content (folders and files) using Java API? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-get-a-site-s-content-folders-and-files-using-java-api/m-p/291122#M244252</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In order to go through all the hierarchy, you can use something like this &lt;A class="link-titled" href="http://www.dedunu.info/2015/03/alfresco-calculate-folder-size-using.html" title="http://www.dedunu.info/2015/03/alfresco-calculate-folder-size-using.html" rel="nofollow noopener noreferrer"&gt;Dedunu Dhananjaya: Alfresco: Calculate folder size using Java based WebScript&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, to get the relationship information, you can use the getChildAssocs method, as you already found out.&lt;/P&gt;&lt;P&gt;You can check the relationship type with something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (nodeService.getType(childNodeRef).equals(ApplicationModel.TYPE_FILELINK)) {&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Nov 2016 00:13:37 GMT</pubDate>
    <dc:creator>douglascrp</dc:creator>
    <dc:date>2016-11-29T00:13:37Z</dc:date>
    <item>
      <title>How to get a Site's content (folders and files) using Java API?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-get-a-site-s-content-folders-and-files-using-java-api/m-p/291118#M244248</link>
      <description>Hello,Could someone&amp;nbsp;tell me what are the steps for getting all Site's content (folders and files) programmatically using Java API?I see that there is&amp;nbsp;FileFolderService, however not sure what information I have to get from a Site in order to proceed and use it in the fileFolderService.Is there some m</description>
      <pubDate>Mon, 28 Nov 2016 12:04:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-get-a-site-s-content-folders-and-files-using-java-api/m-p/291118#M244248</guid>
      <dc:creator>mbel</dc:creator>
      <dc:date>2016-11-28T12:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a Site's content (folders and files) using Java API?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-get-a-site-s-content-folders-and-files-using-java-api/m-p/291119#M244249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try to combine SiteService and FileFolderService/NodeService.&lt;BR /&gt;Use SiteService to get site information and get containers information for the site&lt;BR /&gt;And use FileFolderService/NodeService to get folders and files information.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 15:34:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-get-a-site-s-content-folders-and-files-using-java-api/m-p/291119#M244249</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2016-11-28T15:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a Site's content (folders and files) using Java API?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-get-a-site-s-content-folders-and-files-using-java-api/m-p/291120#M244250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It depends what you mean by "all content of a site" because a site can be sub-structure in components, e.g. a "documentlibrary", "wiki" and others. If you really mean "all content" than you can simply use the FileFolderService operations on the NodeRef of the site itself (obtained via the SiteService). Otherwise you would need to retrieve NodeRef of the relevant component first via SiteService.getContainer(shortName, containerName).&lt;/P&gt;&lt;P&gt;Any looping to retrieve all files and folders will have to be done in your custom code since all operations only act on a single hierarchy level for performance reasons. There is a deprecated listDeepFolders operation which is deprecated specifically for being dangerous in terms of system load / performance.&lt;/P&gt;&lt;P&gt;Note that by accessing ALL files and folders in a large site you can potentially overwhelm the transactional caches (if those files and folders have not been loaded into caches before), which will completely reset the corresponding shared caches and seriously impact performance of the system for all other uesrs. It typically is not recommended to perform bulk operations in a single transaction and instead use batch processing functionality to handle such use cases efficiently.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 15:34:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-get-a-site-s-content-folders-and-files-using-java-api/m-p/291120#M244250</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2016-11-28T15:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a Site's content (folders and files) using Java API?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-get-a-site-s-content-folders-and-files-using-java-api/m-p/291121#M244251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;I know about this BatchProcessor and maybe I will use it after implement the custom logic for getting the whole&amp;nbsp;files and folders. Will create separate discussion about it &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;I managed to get list of containers -&amp;gt; this.siteService.listContainers which returns a Collection of FileInfo and after that loop all FileInfos and get its children - List&amp;lt;FileInfo&amp;gt; files = this.fileFolderService.list(file.getNodeRef());&lt;/P&gt;&lt;P&gt;In general if some file has reference to another file in another Site for example, which is the right way of getting this relationship , through&amp;nbsp;this.nodeService.getChildAssocs(nodeRef) &amp;nbsp;or ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 19:38:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-get-a-site-s-content-folders-and-files-using-java-api/m-p/291121#M244251</guid>
      <dc:creator>mbel</dc:creator>
      <dc:date>2016-11-28T19:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a Site's content (folders and files) using Java API?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-get-a-site-s-content-folders-and-files-using-java-api/m-p/291122#M244252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In order to go through all the hierarchy, you can use something like this &lt;A class="link-titled" href="http://www.dedunu.info/2015/03/alfresco-calculate-folder-size-using.html" title="http://www.dedunu.info/2015/03/alfresco-calculate-folder-size-using.html" rel="nofollow noopener noreferrer"&gt;Dedunu Dhananjaya: Alfresco: Calculate folder size using Java based WebScript&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, to get the relationship information, you can use the getChildAssocs method, as you already found out.&lt;/P&gt;&lt;P&gt;You can check the relationship type with something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (nodeService.getType(childNodeRef).equals(ApplicationModel.TYPE_FILELINK)) {&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2016 00:13:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-get-a-site-s-content-folders-and-files-using-java-api/m-p/291122#M244252</guid>
      <dc:creator>douglascrp</dc:creator>
      <dc:date>2016-11-29T00:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a Site's content (folders and files) using Java API?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-get-a-site-s-content-folders-and-files-using-java-api/m-p/291123#M244253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to have a Site's files hierarchy(which I've already got) + files content and when I have all that in json(for example) I can easily import the data in another alfresco system.&lt;/P&gt;&lt;P&gt;So, I have difficulty in getting the files content. I currently have no idea how to store it and after that how to write it.&lt;/P&gt;&lt;P&gt;What I tested is that if I use&amp;nbsp;the reader = this.fileFolderService.getReader(file.getNodeRef());&lt;/P&gt;&lt;P&gt;I can use its method &amp;nbsp;reader.getContent(new File(file.getName())); which will copy the whole file data and creates the same file in the File path....&lt;/P&gt;&lt;P&gt;Do you have any suggestions how I can get and store the content of a file which I can easily write after that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advace.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2016 15:23:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-get-a-site-s-content-folders-and-files-using-java-api/m-p/291123#M244253</guid>
      <dc:creator>mbel</dc:creator>
      <dc:date>2016-11-29T15:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a Site's content (folders and files) using Java API?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-get-a-site-s-content-folders-and-files-using-java-api/m-p/291124#M244254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="73554" __jive_macro_name="user" _jive_internal="true" data-id="73554" data-objecttype="3" data-type="person" href="https://community.alfresco.com/people/afaust" rel="nofollow noopener noreferrer"&gt;&lt;/A&gt;‌ , Do the Alfresco Exporter and Importer have an implemented BatchProcessor?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2017 09:33:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-get-a-site-s-content-folders-and-files-using-java-api/m-p/291124#M244254</guid>
      <dc:creator>mbel</dc:creator>
      <dc:date>2017-01-18T09:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a Site's content (folders and files) using Java API?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-get-a-site-s-content-folders-and-files-using-java-api/m-p/291125#M244255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The BulkFileSystemImporter uses batch processing internally. The default exporter / importer components are single threaded to ensure consistency of the operation result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2017 10:53:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-get-a-site-s-content-folders-and-files-using-java-api/m-p/291125#M244255</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2017-01-18T10:53:47Z</dc:date>
    </item>
  </channel>
</rss>

