|
OpenAPI 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AQProjectFile
Represents a file-like object within a project. Much like File
,
a file corresponding to an instance of AQProjectFile may or may exist in the file system.
createFolder()
:
var f = aqua.project.getUserFile("FOLDER");
f.createFolder();
Method Summary | |
---|---|
AQProjectFile[] |
collectFilesRecursively()
Recursively collects files in a project folder and its descendant folders, excluding system and hidden files. |
AQProjectFile[] |
collectFilesRecursively(String filter)
Recursively collects files in a project folder and its descendant folders. |
boolean |
createFolder()
Creates a folder corresponding to this file object. |
boolean |
exists()
Returns true if the file exists. |
int |
getLength()
Returns the file length in bytes. |
File |
getLocalFile()
Returns the local java.io.File object representation of the AQProjectFile |
String |
getName()
Returns the file name. |
String |
getPath()
Returns the file path. |
boolean |
isFile()
Returns true if the underlying storage element is a file. |
boolean |
isFolder()
Returns true if the underlying element is a folder. |
AQProjectFile[] |
list()
Returns an array of files and folders in a project folder. |
AQProjectFile[] |
list(String filter)
Returns an array of files and folders in a project folder, satisfying the specified file name filter. |
String |
read()
Reads the file content into a string assuming UTF-8 encoding. |
String |
read(String encoding)
Reads the file content into a string using the specified encoding. |
byte[] |
readBytes()
Reads the file content into a byte array. |
boolean |
remove()
Deletes an underlying file object. |
void |
write(byte[] bytes)
Writes the byte array to a file. |
void |
write(String text)
Writes the text string to a file using UTF-8 encoding. |
void |
write(String text,
String encoding)
Writes the text string to a file using the specified encoding. |
Method Detail |
---|
String getName()
File getLocalFile()
String getPath()
int getLength()
boolean exists()
boolean isFile()
boolean isFolder()
AQProjectFile[] list()
AQProjectFile[] list(String filter)
filter
- File filter specification string.AQProjectFile[] collectFilesRecursively()
AQProjectFile[] collectFilesRecursively(String filter)
null
filter is equivalent to a filter which excludes system and hidden files.
Returns an array of files.
If this project file object does not denote a directory, then this method returns null.
filter
- File filter specification string.boolean remove()
String read() throws Exception
Exception
String read(String encoding) throws Exception
encoding
- Character encoding.
Exception
byte[] readBytes() throws Exception
Exception
void write(String text) throws Exception
text
-
Exception
void write(String text, String encoding) throws Exception
Charset
class.
Example:
write("text\n", "EUC-JP");
text
- encoding
-
Exception
void write(byte[] bytes) throws Exception
bytes
-
Exception
boolean createFolder()
|
OpenAPI 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |