I'm using code from an imported library (that I have no way to modify) and trying to just call the path of the item. This is suppose to be the command to do so:
Document.getSourceWorkspace().getPathById(id, Boolean, boolean)
So for this I am using a DocumentId called contentId as the id and just using "true" for the boolean values:
String contentIdStr = request.getParameter("contentId");
DocumentId contentId = workspace.createDocumentId(contentIdStr);
Document.getSourceWorkspace().getPathById(contentId, true, true);
getPathById is type java.lang.String, so all I want to do (for right now) is display it:
out.println("Path: " + Document.getSourceWorkspace().getPathById(contentId, true, true));
But when I try to run this I get the error: Cannot make a static reference to the non-static method getSourceWorkspace() from the type Document
Since the only code that I wrote here is the out.println, I'm not really sure what is going on. Why can't I simply output it like that? How is that a static reference? What do I need to do to make it non-static (keeping in mind that I can't change anything in the library or whatnot)?
I did try to create a string and assign this to it, but that didn't work either...
String contentPath = Document.getSourceWorkspace().getPathById(contentId, 1, 1);
This is (hopefully) probably simple, but I'm not very familiar with Java at all. I don't really know what the syntax is supposed to be, so maybe I'm just writing it wrong?
Appreciate any help, thanks.