<?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: Fetching files list from folder in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/fetching-files-list-from-folder/m-p/119799#M32943</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/83858"&gt;@akerikels46&lt;/A&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Dear Team,&lt;/P&gt;
&lt;P&gt;I need to get list of files information of one folder by using folder name from site.&lt;/P&gt;
&lt;P&gt;Could you please help on this!&lt;/P&gt;


&lt;P&gt;Kind &amp;amp; Regards.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Looks like this question is exact copy of this thread:&amp;nbsp;&lt;A href="https://hub.alfresco.com/t5/alfresco-content-services-forum/fetching-files-list-from-folder/m-p/303362/highlight/true#M22181" target="_blank" rel="nofollow noopener noreferrer"&gt;https://hub.alfresco.com/t5/alfresco-content-services-forum/fetching-files-list-from-folder/m-p/303362/highlight/true#M22181&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/83858"&gt;@akerikels46&lt;/A&gt;&amp;nbsp; have you checked the above thread ?&lt;/P&gt;</description>
    <pubDate>Sat, 05 Dec 2020 21:39:59 GMT</pubDate>
    <dc:creator>abhinavmishra14</dc:creator>
    <dc:date>2020-12-05T21:39:59Z</dc:date>
    <item>
      <title>Fetching files list from folder</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/fetching-files-list-from-folder/m-p/119797#M32941</link>
      <description>&lt;P&gt;Dear Team,&lt;/P&gt;&lt;P&gt;I need to get list of files information of one folder by using folder name from site.&lt;/P&gt;&lt;P&gt;Could you please help on this!&lt;/P&gt;&lt;P&gt;Kind &amp;amp; Regards.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Dec 2020 08:38:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/fetching-files-list-from-folder/m-p/119797#M32941</guid>
      <dc:creator>akerikels46</dc:creator>
      <dc:date>2020-12-05T08:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching files list from folder</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/fetching-files-list-from-folder/m-p/119798#M32942</link>
      <description>&lt;P&gt;There are couple of ways to do it...&lt;/P&gt;
&lt;P&gt;- Use search to find all the files/folders within a given folder by name path if you know it already. e.g. "/Site/Document Library/FolderA"&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Search query, that will return list of nodes (including files/folders) that are directly within 'FolderA':&lt;/U&gt;&lt;/P&gt;
&lt;PRE&gt;'PATH:"/app:company_home/st:sites/cm:testSite/cm:documentLibrary/cm:FolderA/*"'&lt;/PRE&gt;
&lt;P&gt;&lt;U&gt;Search query, that will return list of nodes (including files/folders) that are anywhere nested within 'FolderA':&lt;/U&gt;&lt;/P&gt;
&lt;PRE&gt;'PATH:"/app:company_home/st:sites/cm:testSite/cm:documentLibrary/cm:FolderA//*"'&lt;/PRE&gt;
&lt;P&gt;&lt;U&gt;Search query, that will return list of nodes (only files) that are anywhere nested within 'FolderA':&lt;/U&gt;&lt;/P&gt;
&lt;PRE&gt;'PATH:"/app:company_home/st:sites/cm:testSite/cm:documentLibrary/cm:FolderA//*" AND (TYPE:"cm:content")'&lt;/PRE&gt;
&lt;P&gt;From resulted nodes, extract the required info as needed.&lt;/P&gt;
&lt;P&gt;If you don't know exact path of the folder but know only name of the folder which can be anywhere in site document library then you can use combination of &lt;A href="http://dev.alfresco.com/resource/AlfrescoOne/5.0/PublicAPI/org/alfresco/service/cmr/search/SearchService.html" target="_blank" rel="noopener nofollow noreferrer"&gt;SearchService&amp;nbsp;&lt;/A&gt;and &lt;A href="https://dev.alfresco.com/resource/docs/java/org/alfresco/service/cmr/model/FileFolderService.html" target="_self" rel="nofollow noopener noreferrer"&gt;FileFolderService&lt;/A&gt;. Using search service locate the nodeRef of the folder and using the nodeRef of the folder list all the files/folders within that folder using file folder service.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SearchService will execute following query to get the node of folder, e.g.:&lt;/P&gt;
&lt;PRE&gt;'PATH:"/app:company_home/st:sites/cm:testSite/cm:documentLibrary//*" AND TYPE:"cm:folder" AND =@cm:\name:"FolderA"'&lt;/PRE&gt;
&lt;P&gt;The above query will return node/nodes matching the exact name. Note you might get multiple nodeRefs if there are multiple folders with same name nested within parent folder (documentLibrary). If you know the exact path of the folder, you can easily use the above given queries that goes until the correct folder name by its path.&lt;/P&gt;
&lt;P&gt;Once you have nodeRef of the folder, you can use FileFolderService e.g.:&lt;/P&gt;
&lt;PRE&gt;List&amp;lt;FileInfo&amp;gt; listOfFiles = fileFolderService.&lt;A href="https://dev.alfresco.com/resource/docs/java/org/alfresco/service/cmr/model/FileFolderService.html#listFiles-org.alfresco.service.cmr.repository.NodeRef-" target="_self" rel="nofollow noopener noreferrer"&gt;listFiles&lt;/A&gt;(folderNodeRef);

Iterate the list and extract the required info.&lt;/PRE&gt;</description>
      <pubDate>Sat, 05 Dec 2020 21:33:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/fetching-files-list-from-folder/m-p/119798#M32942</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2020-12-05T21:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching files list from folder</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/fetching-files-list-from-folder/m-p/119799#M32943</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/83858"&gt;@akerikels46&lt;/A&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Dear Team,&lt;/P&gt;
&lt;P&gt;I need to get list of files information of one folder by using folder name from site.&lt;/P&gt;
&lt;P&gt;Could you please help on this!&lt;/P&gt;


&lt;P&gt;Kind &amp;amp; Regards.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Looks like this question is exact copy of this thread:&amp;nbsp;&lt;A href="https://hub.alfresco.com/t5/alfresco-content-services-forum/fetching-files-list-from-folder/m-p/303362/highlight/true#M22181" target="_blank" rel="nofollow noopener noreferrer"&gt;https://hub.alfresco.com/t5/alfresco-content-services-forum/fetching-files-list-from-folder/m-p/303362/highlight/true#M22181&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/83858"&gt;@akerikels46&lt;/A&gt;&amp;nbsp; have you checked the above thread ?&lt;/P&gt;</description>
      <pubDate>Sat, 05 Dec 2020 21:39:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/fetching-files-list-from-folder/m-p/119799#M32943</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2020-12-05T21:39:59Z</dc:date>
    </item>
  </channel>
</rss>

