Local File Management Scripting Resources

Workflow provides the following methods in the namespace that enable you to perform actions on Local File Management files and folders in scripting.

//Save a new file to the local storage
public ScriptFile saveFile(ScriptFile file, String path);

//Get a file from local storage
public ScriptFile getFile(String path);

//Get all files from a folder
public List getFiles(String path);

//Delete a file
public boolean deleteFile(String path);

//Delete a folder
public boolean deleteFolder(String path);

//Replace a file
public ScriptFile replaceFile(ScriptFile file, String path);

//Create a new folder
public ScriptFile newFolder(String name, String path);

//Get the URL of a file
public String getLink(ScriptFile file);

See the following code samples for how to use the above methods: 

//Get files from myFolder
def files ='/app/myFolder');

//Create and save new file, then get the file
def file = resp.newFile("newFile.txt", "Test file example");, "/app/myFolder");
file ='/app/myFolder/newFile.txt');

//Delete a file

//Create a new folder, then delete the folder'newFolder', '/app');'/app/newFolder');

//Get a file, then get a link for the file
def file ='/app/Happy.png')

//Create new file, save the file, update and then replace the file
def file = resp.newFile("newFile.txt", "Test file example");, "/app/myFolder");
def updatedFile = resp.newFile("newFile.txt", "Test updated file example");, "/app/myFolder")