-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathFile.java
More file actions
33 lines (28 loc) · 713 Bytes
/
File.java
File metadata and controls
33 lines (28 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package snap.webapi;
/**
* This class is a wrapper for Web API File (https://developer.mozilla.org/en-US/docs/Web/API/File).
*/
public class File extends Blob {
/**
* Constructor.
*/
public File(Object jsObj)
{
super(jsObj);
}
/**
* Constructor for name, type and bytes.
*/
public File(String aName, String aType, byte[] byteArray)
{
super(WebEnv.get().newFileJSForNameAndTypeAndBytes(aName, aType, byteArray));
}
/**
* Returns the file name.
*/
public String getName() { return getMemberString("name"); }
/**
* Returns the file type.
*/
public String getType() { return getMemberString("type"); }
}