public class UnmanagedFile extends JSBaseScriptableObject implements IFileObject
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
kServerTypeAttribute
Server type variable name in the global scope.
|
Constructor and Description |
---|
UnmanagedFile() |
Modifier and Type | Method and Description |
---|---|
void |
jsConstructor(java.lang.String thePathName)
Construct a unmanaged file reference to a file that may or may not exist.
|
boolean |
(JavaScript Function) create()
Creates this file and all parent folders.
|
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) getRelativePath()
Get the file's path relative to the MediaBeacon asset root.
|
boolean |
(JavaScript Function) writeXmp()
Saves xmp changes to physical file.
|
java.lang.String |
(JavaScript Getter) colorprofile()
Returns the colorprofile format.
|
java.lang.String |
(JavaScript Getter) colorspace()
Returns the colorspace format.
|
boolean |
(JavaScript Getter) exists()
Tests whether the file denoted by this abstract pathname exists.
|
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.
use getBufferedReader() method instead.
|
int |
(JavaScript Getter) height()
Returns the image height.
|
long |
(JavaScript Getter) lastModified()
Return file modified timestamp in milliseconds
|
long |
(JavaScript Getter) length()
Returns the lenth of the file.
|
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()
Returns the file's absolute path.
|
java.lang.Double |
(JavaScript Getter) resolution()
Returns the image resolution.
|
int |
(JavaScript Getter) width()
Returns the image width.
|
Xmp |
(JavaScript Getter) xmp()
Gets XMP block from 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 kServerTypeAttribute
public void jsConstructor(java.lang.String thePathName) throws java.io.IOException
thePathName
- the absolute or relative path to the file.java.io.IOException
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()
(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) getRelativePath()
public IFolderObject (JavaScript Getter) parent()
(JavaScript Getter) parent
in interface IFileObject
IFileObject
represents parent file or directory.public long (JavaScript Getter) length()
(JavaScript Getter) length
in interface IFileObject
0L
if the file does not exist.public Xmp (JavaScript Getter) xmp()
IFileObject
(JavaScript Getter) xmp
in interface IFileObject
Xmp block.
Xmp
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()
IFileObject
(JavaScript Getter) resolution
in interface IFileObject
@Deprecated public java.lang.String (JavaScript Getter) getFileContents()
(JavaScript Getter) getFileContents
in interface IFileObject
public boolean (JavaScript Function) create() throws java.io.IOException
true
if and only if the directory was created, along with all necessary parent directories; false
otherwisejava.io.IOException
- If an I/O error occurredpublic boolean (JavaScript Function) writeXmp()
(JavaScript Function) writeXmp
in interface IFileObject
public BufferedReader (JavaScript Function) getBufferedReader(java.lang.String theEncoding) throws java.io.IOException
(JavaScript Function) getBufferedReader
in interface IFileObject
java.io.IOException
- if there was an error getting or creating the BufferedReaderBufferedReader
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
- if there was an error getting or creating the BufferedWriterBufferedWriter
public FileOutputStream (JavaScript Function) getFileOutputStream() throws java.io.IOException
(JavaScript Function) getFileOutputStream
in interface IFileObject
java.io.IOException
Copyright © 2017 MediaBeacon, Inc. All Rights Reserved.