How to know CIFS path programmaticaly ?

marinew
Champ in-the-making
Champ in-the-making
Hello,

I would like to know how to get CIFS URL from a Node object. For exemple :

Node myNode = ….;
String cifsUrl = myNode.???();

=> Result : cifsUrl contains "\\MyServer_A\Path\to\the\file.pdf

I have been searching for hours and did not found answer.

Thanks.
4 REPLIES 4

jcblitz
Champ in-the-making
Champ in-the-making
I was just wondering this myself. I wrote some code that parsed the path and preappend a few values, but it seems hacky to me. Is there a better method to do this?

I'm using the webservice API and I'm doing something like

ResultSet resultSet = queryResult.getResultSet();
ResultSetRow[] rows = resultSet.getRows();
…
ResultSetRow row = rows[x]
…
NamedValue[] columns = row.getColumns()
…
‍‍‍‍‍‍‍‍‍

Find the path to the file and then run…


private static String removeNamespace(String path) {      
      return path.replaceAll("(\\{.*?\\})", "");      
   }
‍‍‍‍‍

The problem I'm seeing is the path contains /Company Home/ while the CIFS link through the web client does not. I guess I can kind of fix this by changing the root in the CIFS config, but I would rather not.

marinew
Champ in-the-making
Champ in-the-making
Hello,

Some time ago, I also posted the same question on the french forum : http://forum.alfresco-fr.org/viewtopic.php?pid=4430
You may find some help here.
I haven't tested it yet, but I certainly will have to during next months.

xerox
Champ in-the-making
Champ in-the-making
the CIFS path to the node:

Utils.generateURL(FacesContext.getCurrentInstance(), node, URLMode.CIFS);‍

Friendly regards,

Nick

jcblitz
Champ in-the-making
Champ in-the-making
the CIFS path to the node:

Utils.generateURL(FacesContext.getCurrentInstance(), node, URLMode.CIFS);‍

Friendly regards,

Nick

Is there any way to do it with classes just from the webservice jar?