(.js)
laraImport("lara.Io");
(.lara)
import lara.Io;
Classes:
Global Functions:
Io
Utility methods related with input/output operations on files.
appendFile(path, content)
copyFile(filepath, destination)
copyFolder(filepath, destination, verbose)
deleteFile(fileOrBaseFolder, optionalFile)
Deletes the given file.
deleteFiles()
Each argument is a file that will be deleted.
deleteFolder(folderPath)
Deletes a folder and its contents.
deleteFolderContents(folderPath)
Deletes the contents of a folder.
getAbsolutePath(fileOrBaseFolder, optionalFile)
getExtension(path)
Returns the extension of the given path.
getFiles(baseFolder, pattern, isRecursive)
The files inside the given folder that respects the given pattern.
getFolders(baseFolder, patterns)
Gets the folders in the given folder, corresponding to the given base folder and argument patterns.
getPath(fileOrBaseFolder, optionalFile)
getPathSeparator()
The system-dependent path-separator (e.g., : or ;).
getPaths(baseFolder, patterns)
Gets the paths (files and folders) in the given folder, corresponding to the given base folder and argument patterns.
getRelativePath(targetFile, baseFile)
Returns the path of 'targetFile', relative to 'baseFile'.
If the file does not share a common ancestor with baseFile, returns undefined.
getSeparator()
The system-dependent name-separator (e.g., / or \).
getTempFolder(folderName)
If folderName is undefined, returns the OS temporary folder.
If defined, creates a new folder inside the system's temporary folder and returns it.
getWorkingFolder()
isFile(path)
isFolder(path)
isJavaFile(object)
jsonObject(value)
If value is a string that ends in .json, assume it is a file to a json object and parses it.
If it is a string but does not end in json, assume it is a stringified object.
Otherwise, returns the object as it is.
md5(fileOrBaseFolder, optionalFile)
mkdir(fileOrBaseFolder, optionalFile)
Creates a folder.
newRandomFolder()
Creates a randomly named folder in the OS temporary folder that is deleted when the virtual machine exits.
readFile(path)
readJson(path)
readLines(fileOrBaseFolder, optionalFile)
Returns a List with a string for each line of the given file
removeExtension(path)
Returns the given path, without extension.
writeFile(path, content)
writeJson(path, object)
deleteFile(fileOrBaseFolder, optionalFile)
Global version of the function.
mkdir(fileOrBaseFolder, optionalFile)
Global version of the function.
readLines(fileOrBaseFolder, optionalFile)
Global version of the function.