public class JSFileManager extends JSBaseScriptableObject
Modifier and Type | Field and Description |
---|---|
static java.util.List |
kBundleTypes
Trigger Event types.
|
Constructor and Description |
---|
JSFileManager() |
Modifier and Type | Method and Description |
---|---|
IFileObject |
(JavaScript Function) compressFiles(org.mozilla.javascript.NativeArray theFiles,
java.lang.String theDestinationFile,
int theCompressionType)
Compresses a list of files into a specified format of archive file.
|
Bundle |
(JavaScript Function) createBundleFolder(java.lang.String theBundlePath,
BundleType theBundleFlag)
Creates a folder bundle.
|
org.mozilla.javascript.Scriptable |
(JavaScript Function) decompressFiles(ManagedFile theFile,
ManagedFolder theOutputDir)
Decompress a file.
|
IFileObject |
(JavaScript Function) fileCopy(IFileObject theSrc,
IFolderObject theDest)
Copy a File.
|
void |
(JavaScript Function) fileDelete(IFileObject theFile)
Delete a file.
|
ManagedFile |
(JavaScript Function) fileDuplicate(ManagedFile theFile)
Duplicate a file.
|
ManagedFile |
(JavaScript Function) fileImport(IFileObject theFile,
ImportParameters theParameters)
Imports or re-imports a file.
|
IFileObject |
(JavaScript Function) fileMove(IFileObject theSrc,
IFolderObject theDest,
java.lang.Boolean theOverwrite)
Move a file.
|
IFileObject |
(JavaScript Function) fileNew(IFolderObject theDestinationFolder,
java.lang.String theNewName)
Create a new file.
|
IFileObject |
(JavaScript Function) fileNewByPath(java.lang.String theFilePath)
Creates the new file by path.
|
IFileObject |
(JavaScript Function) fileRename(IFileObject theFile,
java.lang.String theNewName)
Rename a file.
|
ManagedFile |
(JavaScript Function) fileReplace(ManagedFile theSrc,
ManagedFile theDest)
Replace an asset with another asset, maintaining the replaced asset's metadata.
|
IFolderObject |
(JavaScript Function) folderCopy(IFolderObject theSrc,
IFolderObject theDest,
java.lang.String theDestName)
Copy a folder.
|
void |
(JavaScript Function) folderDelete(IFolderObject theFolder)
Delete a folder.
|
ManagedFolder |
(JavaScript Function) folderImport(IFolderObject theFolder,
java.lang.Boolean theDoNotDescend)
Imports or re-imports a folder.
|
ManagedFolder |
(JavaScript Function) folderImportWithParameters(IFolderObject theFolder,
ImportParameters theParameters)
Imports or re-imports a folder.
|
IFolderObject |
(JavaScript Function) folderMove(IFolderObject theSrc,
IFolderObject theDest,
java.lang.String theFolderName)
Move a folder.
|
IFolderObject |
(JavaScript Function) folderNew(IFolderObject theDestinationFolder,
java.lang.String theNewFolder)
Create a folder.
|
IFolderObject |
(JavaScript Function) folderNewByPath(java.lang.String theFolderPath)
Creates the new folder by path.
|
IFolderObject |
(JavaScript Function) folderRename(IFolderObject theFolder,
java.lang.String theNewName)
Rename a folder.
|
IFileObject |
(JavaScript Function) getFile(IFolderObject theParentFolder,
java.lang.String theFileName)
Gets a reference the given file in the given path, if the file doesn't exist or isn't a regular file, return null.
|
ManagedFile |
(JavaScript Function) getFileObjectById(int theNewAssetId)
Creates a new
IFileObject object for the given asset ID. |
java.util.List |
(JavaScript Function) getFilePaths(IFolderObject theDir,
boolean theReturnAllFiles)
Deprecated.
use
ManagedFolder.(JavaScript Function) getContents or UnmanagedFolder.(JavaScript Function) getContents instead. This function
will fail for folders outside of the MediaBeacon asset root. |
ManagedFolder |
(JavaScript Function) getFolderObjectById(int theFolderId)
Creates a new
ManagedFolder object for the given folder ID. |
ManagedFile |
(JavaScript Function) getManaged(UnmanagedFile theFile)
Get managed file reference to the given unmanaged file if it is managed by MediaBeacon.
|
PDF |
(JavaScript Function) getPdfFromManagedFile(ManagedFile theFile)
Get a PDF object from a ManagedFile object
|
java.lang.String |
(JavaScript Function) getRelativePath(IFileObject theFile)
Deprecated.
use
ManagedFile.(JavaScript Getter) path or UnmanagedFile.(JavaScript Function) getRelativePath instead. |
boolean |
(JavaScript Function) isFile(java.lang.String theRelativePath)
Check if there is a file located at a given relative path.
|
boolean |
(JavaScript Function) isFolder(java.lang.String theRelativePath)
Check if there is a folder located at a given relative path.
|
boolean |
(JavaScript Function) isManaged(org.mozilla.javascript.Scriptable theFile)
Check if the file or folder is managed by MediaBeacon.
|
boolean |
(JavaScript Function) isManagedFilePath(java.lang.String theRelativePath)
Is the given path, relative to the MediaBeacon asset root, a path to a file currently managed by MediaBeacon.
|
boolean |
(JavaScript Function) isManagedFolderPath(java.lang.String theRelativePath)
Is the given path, relative to the MediaBeacon asset root, a path to a folder currently managed by MediaBeacon.
|
boolean |
(JavaScript Function) postFileCopy(java.lang.String theOldPath,
java.lang.String theNewPath)
This method is available only in M4sterPlan-licensed MediaBeacon.
|
boolean |
(JavaScript Function) postFileRename(java.lang.String theOldPath,
java.lang.String theNewPath)
This method is available only in M4sterPlan-licensed MediaBeacon.
|
IFileObject |
(JavaScript Function) rawFileCopy(IFileObject theSrc,
IFolderObject theDest,
int theFork)
Copy a File without calling import on the destination file, optionally only data or only resource fork.
|
void |
(JavaScript Function) removeBundleMetadata(java.lang.String theBundlePath)
Remove everything associated with a bundle, including the metadata asset.
|
ManagedFile |
(JavaScript Function) replaceAsset(IFileObject theSrc,
ManagedFile theDest,
boolean theIsRename)
Replaces asset data with uploaded file that resides on the portal server.
|
void |
(JavaScript Function) setPendingUploadFilesAvailable(IFolderObject theFolder,
java.lang.String thePendingUploadId,
java.lang.String theProgressId,
java.lang.String theTargetDir)
Notify MB that pending uploads are available
|
JSMap |
(JavaScript Getter) bundleTypes() |
associateValue, avoidObjectDetection, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassName, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasInstance, hasProperty, hasProperty, isConst, isEmpty, isExtensible, isSealed, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
public boolean (JavaScript Function) isFile(java.lang.String theRelativePath) throws java.lang.Exception
theRelativePath
- the path, relative to the MediaBeacon asset root, to a file.
This path should contain unix-style file separators regardless of what file system hosts the assets.java.lang.Exception
public boolean (JavaScript Function) isFolder(java.lang.String theRelativePath) throws java.lang.Exception
theRelativePath
- the path, relative to the MediaBeacon asset root, to a folder.
This path should contain unix-style file separators regardless of what file system hosts the assets.java.lang.Exception
public boolean (JavaScript Function) isManagedFilePath(java.lang.String theRelativePath)
theRelativePath
- The relative path to a file potentially managed by MediaBeacon.public boolean (JavaScript Function) isManagedFolderPath(java.lang.String theRelativePath)
theRelativePath
- The relative path to a folder potentially managed by MediaBeacon.public boolean (JavaScript Function) isManaged(org.mozilla.javascript.Scriptable theFile)
theFile
- the file or folder to check.true
if the given file or folder is managed by MediaBeacon, false
otherwise.public IFileObject (JavaScript Function) getFile(IFolderObject theParentFolder, java.lang.String theFileName) throws java.lang.Exception
theParentFolder
- The folder that contains the file to get a reference to.theFileName
- The name of the potentially of extant file.null
.java.lang.Exception
- exception thrown during check.public ManagedFile (JavaScript Function) getManaged(UnmanagedFile theFile)
theFile
- the unmanaged file to potentially get a managed reference to.public IFileObject (JavaScript Function) fileNew(IFolderObject theDestinationFolder, java.lang.String theNewName) throws java.lang.Exception
theDestinationFolder
- the folder to put the new file in.theNewName
- the name of the new file.java.lang.Exception
- exception thrown if a problem occurs while creating the file.public IFileObject (JavaScript Function) fileNewByPath(java.lang.String theFilePath) throws java.lang.Exception
theFilePath
- the path to the file to be created. This path can be absolute or relative to the MediaBeacon
asset root folder. Absolute paths should use a file separator that is matches the file system while relative paths
should always uses a unix-style file separator.java.lang.Exception
public IFolderObject (JavaScript Function) folderNewByPath(java.lang.String theFolderPath) throws java.lang.Exception
theFolderPath
- the path to the folder to be created. This path can be absolute or relative to the MediaBeacon
asset root folder. Absolute paths should use a file separator that is matches the file system while relative paths
should always uses a unix-style file separator.java.lang.Exception
public ManagedFile (JavaScript Function) getFileObjectById(int theNewAssetId)
IFileObject
object for the given asset ID.theNewAssetId
- the asset id.IFileObject
instance.public boolean (JavaScript Function) postFileRename(java.lang.String theOldPath, java.lang.String theNewPath) throws FileSystemException
theOldPath
- the file's previous path.theNewPath
- the file's current path.FileSystemException
public boolean (JavaScript Function) postFileCopy(java.lang.String theOldPath, java.lang.String theNewPath) throws FileSystemException
theOldPath
- the file's previous path.theNewPath
- the file's current path.FileSystemException
public IFileObject (JavaScript Function) fileRename(IFileObject theFile, java.lang.String theNewName) throws FileSystemException
theFile
- the file to rename.theNewName
- the new name of the file.FileSystemException
- exception thrown during file renaming.public IFileObject (JavaScript Function) rawFileCopy(IFileObject theSrc, IFolderObject theDest, int theFork) throws FileSystemException
theSrc
- the file to copy.theDest
- the destination of the copy.theFork
- copy resource only (1), data and resource (2), or data only (3)FileSystemException
- exception thrown during copy.public IFileObject (JavaScript Function) fileCopy(IFileObject theSrc, IFolderObject theDest) throws FileSystemException
theSrc
- the file to copy.theDest
- the destination of the copy.FileSystemException
- exception thrown during copy.public void (JavaScript Function) fileDelete(IFileObject theFile) throws FileSystemException
theFile
- the file to delete.FileSystemException
- exception thrown during delete.public ManagedFile (JavaScript Function) fileDuplicate(ManagedFile theFile) throws FileSystemException
theFile
- the file to duplicate.FileSystemException
- exception thrown during duplicate.public IFileObject (JavaScript Function) compressFiles(org.mozilla.javascript.NativeArray theFiles, java.lang.String theDestinationFile, int theCompressionType) throws FileSystemException
theFiles
- list of files to include in archivetheDestinationFile
- the name of the new archivetheCompressionType
- the type of compression, kWinZip (1), kMacZip (2), kStuffitZip (3)FileSystemException
- if the operation cannot be completedpublic org.mozilla.javascript.Scriptable (JavaScript Function) decompressFiles(ManagedFile theFile, ManagedFolder theOutputDir) throws FileSystemException
theFile
- the archive to decompress.theOutputDir
- the directory to decompress to.FileSystemException
- exception thrown during decompress.public IFileObject (JavaScript Function) fileMove(IFileObject theSrc, IFolderObject theDest, java.lang.Boolean theOverwrite) throws FileSystemException
theSrc
- the file to move.theDest
- the destination of the file.theOverwrite
- overwrite (un-imported) destination if true. (optional)FileSystemException
- exception thrown during file move.public void (JavaScript Function) setPendingUploadFilesAvailable(IFolderObject theFolder, java.lang.String thePendingUploadId, java.lang.String theProgressId, java.lang.String theTargetDir) throws FileSystemException
theFolder
- the folder where the files are waitingFileSystemException
public ManagedFile (JavaScript Function) fileImport(IFileObject theFile, ImportParameters theParameters) throws FileSystemException
theFile
- The file to importtheParameters
- the import parameters (optional)FileSystemException
public ManagedFolder (JavaScript Function) folderImportWithParameters(IFolderObject theFolder, ImportParameters theParameters) throws FileSystemException
theFolder
- The folder to import.theParameters
- the import parametersFileSystemException
public ManagedFolder (JavaScript Function) folderImport(IFolderObject theFolder, java.lang.Boolean theDoNotDescend) throws FileSystemException
theFolder
- The folder to import.theDoNotDescend
- When importing an unmanaged folder, set this flag to block import of internal files and folders.FileSystemException
public ManagedFile (JavaScript Function) fileReplace(ManagedFile theSrc, ManagedFile theDest) throws FileSystemException
theSrc
- The asset to replace with.theDest
- The asset to replace.FileSystemException
- if the source or destination file doesn't exist, isn't imported or if an error occurs
during the replace.public ManagedFile (JavaScript Function) replaceAsset(IFileObject theSrc, ManagedFile theDest, boolean theIsRename) throws FileSystemException
theSrc
- the source filetheDest
- the destination assettheIsRename
- should the file be renamed?FileSystemException
public IFolderObject (JavaScript Function) folderCopy(IFolderObject theSrc, IFolderObject theDest, java.lang.String theDestName) throws FileSystemException
theSrc
- the folder to copy.theDest
- the folder to copy to.theDestName
- the name of the resulting folderFileSystemException
- exception thrown during folder copy.public void (JavaScript Function) folderDelete(IFolderObject theFolder) throws FileSystemException
theFolder
- the folder to delete.FileSystemException
- exception thrown during folder delete.public IFolderObject (JavaScript Function) folderNew(IFolderObject theDestinationFolder, java.lang.String theNewFolder) throws FileSystemException
theDestinationFolder
- the folder to create in.theNewFolder
- the name of the folder to create.FileSystemException
- exception thrown during folder creation.public IFolderObject (JavaScript Function) folderRename(IFolderObject theFolder, java.lang.String theNewName) throws FileSystemException
theFolder
- the folder to rename.theNewName
- the new name of the folder.FileSystemException
- exception thrown during folder renaming.public IFolderObject (JavaScript Function) folderMove(IFolderObject theSrc, IFolderObject theDest, java.lang.String theFolderName) throws FileSystemException
theSrc
- the folder to move.theDest
- the folder to move to.theFolderName
- the name of the resulting folder.FileSystemException
- exception thrown during folder move.public ManagedFolder (JavaScript Function) getFolderObjectById(int theFolderId)
ManagedFolder
object for the given folder ID.theFolderId
- the asset id.ManagedFolder
instance.@Deprecated public java.util.List (JavaScript Function) getFilePaths(IFolderObject theDir, boolean theReturnAllFiles) throws java.lang.Exception
ManagedFolder.(JavaScript Function) getContents
or UnmanagedFolder.(JavaScript Function) getContents
instead. This function
will fail for folders outside of the MediaBeacon asset root.theDir
- the folder to find files in.theReturnAllFiles
- if true, return all files, not just droplets and scripts.java.lang.Exception
- exception thrown while finding files.@Deprecated public java.lang.String (JavaScript Function) getRelativePath(IFileObject theFile) throws java.lang.Exception
ManagedFile.(JavaScript Getter) path
or UnmanagedFile.(JavaScript Function) getRelativePath
instead.theFile
- the file to get a relative path to.java.lang.Exception
public PDF (JavaScript Function) getPdfFromManagedFile(ManagedFile theFile)
theFile
- the ManagedFilepublic Bundle (JavaScript Function) createBundleFolder(java.lang.String theBundlePath, BundleType theBundleFlag)
theBundlePath
- The path to the new bundle.theBundleFlag
- The bundle type. One of 'transparent_bundle' or 'opaque_bundle'.BundleType
public void (JavaScript Function) removeBundleMetadata(java.lang.String theBundlePath)
theBundlePath
- The relative path to the new bundle.public JSMap (JavaScript Getter) bundleTypes()
Copyright © 2017 MediaBeacon, Inc. All Rights Reserved.