cancel
Showing results for 
Search instead for 
Did you mean: 

create a ws client that gets the list of files from a folder

sidra
Champ in-the-making
Champ in-the-making
HI,
i am trying to get the files of a folder, so i tried to use FileFolderService class which I have found …

   my code is like this..
NodeRef padre=null;
        try{
         padre = new NodeRef("/app:company_home/cm:sample_folder");
         System.out.println(padre == null);
        }catch(Exception ex){
            System.err.println("MIKI ERROR:"+ex.getMessage());
            ex.printStackTrace(System.err);
        }
       
       List<FileInfo> ls = fileFolderService.list(padre);
       for (FileInfo info : ls)
          System.out.println(info.toString());
      
  
but it looks that somthing is wrong and i don't know what that should be…

I'm getting this error:

[size=85]MIKI ERROR:Invalid store ref: Does not contain ://   app:company_home/
org.alfresco.error.AlfrescoRuntimeException: Invalid store ref: Does not contain ://   app:company_home/
   at org.alfresco.service.cmr.repository.StoreRef.<init>(StoreRef.java:75)
   at org.alfresco.service.cmr.repository.NodeRef.<init>(NodeRef.java:93)
   at a.Main.main(Main.java:90)
Exception in thread "main" java.lang.NullPointerException
   at a.Main.main(Main.java:97)[/size]

if you have any ideas please help me

Thank you
1 REPLY 1

rivetlogic
Champ on-the-rise
Champ on-the-rise
If you are using this constructor you should be passing the noderef string which may look like

workspace://SpacesStore/781b39dd-0242-11dd-bec3-cf5c456811a4
<pre><storeref>/<nodeId></pre>

Where workspace://SpacesStore/  is the storeref and   781b39dd-0242-11dd-bec3-cf5c456811a4 is the node id.

Best way to get the noderef is to search for the node using path/name etc and get the desired noderef.

http://wiki.alfresco.com/wiki/Search

Best regards,
Shagul