public class AttachedFile extends Object
Constructor and Description |
---|
AttachedFile(InputStream content,
String fileName)
Creates a new file attachment.
|
AttachedFile(InputStream content,
String fileName,
long fileSize)
Creates a new file attachment.
|
AttachedFile(Path file)
Creates a new file attachment.
|
AttachedFile(Path file,
String fileName)
Creates a new file attachment.
|
Modifier and Type | Method and Description |
---|---|
String |
getContentDisposition()
Content disposition header.
|
MediaType |
getContentType()
File content type.
|
String |
getFileName()
File name.
|
long |
getFileSize()
File size or
-1 if unknown. |
InputStream |
stream()
File content.
|
String |
toString() |
public AttachedFile(@Nonnull InputStream content, @Nonnull String fileName, long fileSize)
content
- File content.fileName
- Filename.fileSize
- File size or -1
if unknown.public AttachedFile(@Nonnull InputStream content, @Nonnull String fileName)
content
- File content.fileName
- Filename.public AttachedFile(@Nonnull Path file, @Nonnull String fileName) throws IOException
file
- File content.fileName
- Filename.IOException
- For IO exception while reading file.public AttachedFile(@Nonnull Path file) throws IOException
file
- File content.IOException
- For IO exception while reading file.public long getFileSize()
-1
if unknown.-1
if unknown.public MediaType getContentType()
public String getFileName()
public String getContentDisposition()
public InputStream stream()
Copyright © 2020. All rights reserved.