Package com.teamdev.jxbrowser.net
Interface File
public interface File
A file data. Depending on how the request was constructed can contain the path to a file, or the
bytes representing a file. Contains the path when the value is taken from an
<input
type="file">
element of the submitted form. May contain bytes in case the request in the
multipart/form-data
format was constructed manually in a JavaScript code.-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault Optional<byte[]>
Returns the file value as an array of bytes.default String
Returns a string that represents the content type determined by the file extension.default String
name()
Returns a string that represents the file name.static File.Builder
Creates a newFile
builder.Returns the file value as a file path.
-
Method Details
-
newBuilder
Creates a newFile
builder.- Returns:
- a new
File.Builder
instance
-
name
Returns a string that represents the file name. -
contentType
Returns a string that represents the content type determined by the file extension. Equalsapplication/octet-stream
when there is no MIME type associated with the file extension. -
pathValue
Returns the file value as a file path. -
bytesValue
Returns the file value as an array of bytes.
-