1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
492 views
by michael-s-4691 (220 points)
I'm working on a process that will be moving files throughout some UNC paths, and I'm needing to keep track of the owner of the document (i.e. the person that created the file) during this process.  Is there a way to get this information within Qvera?

1 Answer

+1 vote
 
Best answer

With Qvera you can write functions and scripts that take advantage of Java and Javascript. That being said you can take advantage of Java class in order to get properties of a file.

Here is how I would find the document owner:

// First get the path to your file
var path = java.nio.file.Paths.get("C:\\Users\\Michael\\Desktop\\fhir_starter_example.docx");
// Now get a view of the attribute
var ownerAttributeView = java.nio.file.Files.getFileAttributeView(path, java.nio.file.attribute.FileOwnerAttributeView);
// Set the owner
var owner = ownerAttributeView.getOwner();
// Debug out the name of the owner
qie.debug('Owner: ' + owner.getName());

by michael-h-5027 (14.8k points)
selected by michael-s-4691
by michael-s-4691 (220 points)
Perfect.  Worked flawlessly.
...