public class ManagedFile extends JSBaseScriptableObject implements IFileObject
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
kManagedFileClassName
The default class name.
|
static java.lang.String |
kServerTypeAttribute
Server type variable name in the global scope.
|
Constructor and Description |
---|
ManagedFile() |
Modifier and Type | Method and Description |
---|---|
void |
jsConstructor(java.lang.String theRelativePath)
Creates a managed file instance.
|
boolean |
(JavaScript Function) applyStampXml(java.lang.String theXml)
Apply XML from XMP Stamp panel to the asset.
|
java.lang.String |
(JavaScript Function) getAbsolutePath()
Get the file's absolute path.
|
BufferedReader |
(JavaScript Function) getBufferedReader(java.lang.String theEncoding)
Returns a BufferedReader for reading the file contents.
|
BufferedWriter |
(JavaScript Function) getBufferedWriter(boolean theAppend,
java.lang.String theEncoding)
Returns a BufferedWriter for writing the file contents.
|
FileOutputStream |
(JavaScript Function) getFileOutputStream()
Gets a FileOutputStream for writing the file contents.
|
java.lang.String |
(JavaScript Function) getFormattedSize()
Get the size of the file with units.
|
java.lang.String |
(JavaScript Function) getImageURL(java.lang.String theViewType)
Returns the image URL for the specified view type ("thumbnails" or "viewex").
|
void |
(JavaScript Function) lock()
Creates a MediaBeacon-managed lock on this ManagedFile.
|
void |
(JavaScript Function) normalizeXmp()
Synchronizes XMP and moves resource / sidecar into data fork of file.
|
void |
(JavaScript Function) releaseXmp()
Releases the fetched XMP object (if it's been fetched) so its memory can be reclaimed.
|
void |
(JavaScript Function) unlock()
Unlocks this managed file.
|
boolean |
(JavaScript Function) writeXmp()
Saves xmp changes to the asset (db and file system).
|
int |
(JavaScript Getter) assetId()
Returns the asset ID.
|
java.lang.String |
(JavaScript Getter) colorprofile()
Returns the image colorprofile
|
java.lang.String |
(JavaScript Getter) colorspace()
Returns the image colorspace
|
java.lang.String |
(JavaScript Getter) encodedAssetId()
Returns the encoded asset ID.
|
boolean |
(JavaScript Getter) exists()
Checks if this file exists on the server's file system.
|
IFileObject |
(JavaScript Getter) file()
Returns itself, needed for backwards-compatability.
|
java.lang.String |
(JavaScript Getter) fileNameExtension()
Returns the file name extension by parsing the file's name.
|
java.lang.String |
(JavaScript Getter) format()
Returns the image format
|
java.lang.String |
(JavaScript Getter) getFileContents()
Deprecated.
|
java.lang.String |
(JavaScript Getter) getXmlFileContents()
Get the file contents as a string, stripping away invalid Xml characters.
|
int |
(JavaScript Getter) height()
Returns the image height
|
long |
(JavaScript Getter) lastModified()
Return file modified timestamp in milliseconds.
|
long |
(JavaScript Getter) length()
Get the file's content length.
|
java.lang.String |
(JavaScript Getter) name()
Returns the name of the file or directory.
|
IFolderObject |
(JavaScript Getter) parent()
Returns the parent file o directory.
|
java.lang.String |
(JavaScript Getter) path()
Get the file's path relative to the MediaBeacon asset root.
|
long |
(JavaScript Getter) rawLength()
Get the raw file size, without metadata
|
java.lang.Double |
(JavaScript Getter) resolution()
Get image resolution.
|
int |
(JavaScript Getter) width()
Returns the image width
|
Xmp |
(JavaScript Getter) xmp()
Gets XMP object.
|
void |
(JavaScript Setter) xmp(java.lang.Object theXmp)
Writes the given Xmp object or xmp string to the file
|
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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final java.lang.String kManagedFileClassName
public static final java.lang.String kServerTypeAttribute
public int (JavaScript Getter) assetId()
public java.lang.String (JavaScript Getter) encodedAssetId()
public IFileObject (JavaScript Getter) file()
IFileObject
.IFileObject
public void jsConstructor(java.lang.String theRelativePath) throws InvalidManagedFilePathException
theRelativePath
- The path, relative to the MediaBeacon asset root, to a file currently managed by MediaBeacon.
This path should contain unix-style file separators regardless of what file system hosts the assets.InvalidManagedFilePathException
- if the file does not exist or isn't managed by MediaBeacon.public void (JavaScript Function) lock() throws ConcurentActionsException, java.lang.InterruptedException
ConcurentActionsException
- if unable to obtain a lock within the system property-configurable amount of time.
Also thrown if this ManagedFile object is stale and the file it references has been deleted, renamed or moved since
this ManagedFile object was constructed.java.lang.InterruptedException
- if the thread was interrupted while waiting for the lock.public void (JavaScript Function) unlock()
public boolean (JavaScript Getter) exists()
(JavaScript Getter) exists
in interface IFileObject
true
if the file or directory exists.public long (JavaScript Getter) lastModified()
(JavaScript Getter) lastModified
in interface IFileObject
public java.lang.String (JavaScript Getter) name()
IFileObject
(JavaScript Getter) name
in interface IFileObject
public java.lang.String (JavaScript Getter) fileNameExtension()
(JavaScript Getter) fileNameExtension
in interface IFileObject
public java.lang.String (JavaScript Getter) path()
(JavaScript Getter) path
in interface IFileObject
public java.lang.String (JavaScript Function) getAbsolutePath()
public IFolderObject (JavaScript Getter) parent()
IFileObject
(JavaScript Getter) parent
in interface IFileObject
IFileObject
represents parent file or directory.public java.lang.String (JavaScript Function) getFormattedSize()
public long (JavaScript Getter) length()
(JavaScript Getter) length
in interface IFileObject
0L
if the file does not exist.public long (JavaScript Getter) rawLength()
@Deprecated public java.lang.String (JavaScript Getter) getFileContents()
(JavaScript Getter) getFileContents
in interface IFileObject
public BufferedReader (JavaScript Function) getBufferedReader(java.lang.String theEncoding) throws java.io.IOException
(JavaScript Function) getBufferedReader
in interface IFileObject
theEncoding
- default is UTF-8, can pass others (like UTF-16)java.io.IOException
BufferedReader
public BufferedWriter (JavaScript Function) getBufferedWriter(boolean theAppend, java.lang.String theEncoding) throws java.io.IOException
(JavaScript Function) getBufferedWriter
in interface IFileObject
theAppend
- true if file should be opened for appendtheEncoding
- default is UTF-8, can pass others (like UTF-16)java.io.IOException
BufferedWriter
public FileOutputStream (JavaScript Function) getFileOutputStream() throws java.io.IOException
(JavaScript Function) getFileOutputStream
in interface IFileObject
java.io.IOException
public java.lang.String (JavaScript Getter) getXmlFileContents()
public boolean (JavaScript Function) applyStampXml(java.lang.String theXml)
theXml
- the stamper XMLpublic Xmp (JavaScript Getter) xmp()
(JavaScript Getter) xmp
in interface IFileObject
Xmp
public void (JavaScript Setter) xmp(java.lang.Object theXmp)
theXmp
- public void (JavaScript Function) normalizeXmp()
public boolean (JavaScript Function) writeXmp()
(JavaScript Function) writeXmp
in interface IFileObject
public void (JavaScript Function) releaseXmp()
public int (JavaScript Getter) width()
(JavaScript Getter) width
in interface IFileObject
public int (JavaScript Getter) height()
(JavaScript Getter) height
in interface IFileObject
public java.lang.String (JavaScript Getter) format()
(JavaScript Getter) format
in interface IFileObject
public java.lang.String (JavaScript Getter) colorspace()
(JavaScript Getter) colorspace
in interface IFileObject
public java.lang.String (JavaScript Getter) colorprofile()
(JavaScript Getter) colorprofile
in interface IFileObject
public java.lang.Double (JavaScript Getter) resolution()
(JavaScript Getter) resolution
in interface IFileObject
public java.lang.String (JavaScript Function) getImageURL(java.lang.String theViewType)
theViewType
- the view type ("thumbnails" or "viewex").Copyright © 2017 MediaBeacon, Inc. All Rights Reserved.