public class Document extends Object implements Serializable
Constructor and Description |
---|
Document(File file,
String type)
Used to create a document based on a existing file.
|
Modifier and Type | Method and Description |
---|---|
void |
delete()
Delete the file, taking care of closing an open input stream.
|
String |
getAtomName()
Returns the parameter name.
|
String |
getExtension()
Returns the file extension.
|
File |
getFile()
Returns the uploaded file.
|
String |
getFileName()
Returns the file name without extension.
|
String |
getFileNameWithExtension()
Returns the full file name with extension (if existing).
|
long |
getLength()
Returns the file length in bytes.
|
InputStream |
getStream()
Returns a stream from the uploaded file.
|
String |
getType()
Returns the mime type for this file.
|
void |
setAtomName(String name)
Sets the parameter name.
|
void |
setExtension(String ext) |
void |
setFile(File in)
Sets a reference to the uploaded file.
|
void |
setFileName(String name)
Sets the file name without extension.
|
void |
setType(String type)
Sets the mime type for this file.
|
public void setAtomName(String name)
name
- parameter namepublic String getAtomName()
public void setFileName(String name)
name
- file name without extensionpublic String getFileName()
public String getFileNameWithExtension()
public void setType(String type)
type
- mime typepublic String getType()
public void setFile(File in)
in
- filepublic void setExtension(String ext)
public String getExtension()
public long getLength()
public InputStream getStream()
public File getFile()
public void delete()
Copyright © 2003–2018 Magnolia International Ltd.. All rights reserved.