public class FileSystemResourceStream extends AbstractResourceStream implements IFixedLocationResourceStream
IResourceStream
,
IModifiable
,
Serialized FormConstructor and Description |
---|
FileSystemResourceStream(File file)
Constructor.
|
FileSystemResourceStream(File file)
Constructor.
|
FileSystemResourceStream(Path path)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the resource.
|
String |
getContentType()
Gets the mime type of this resource
|
InputStream |
getInputStream()
Gets the resource stream.
|
Path |
getPath() |
Time |
lastModifiedTime()
Gets the last time this modifiable thing changed.
|
Bytes |
length()
Gets the size of this resource
|
String |
locationAsString() |
String |
toString() |
getLocale, getStyle, getVariation, setLocale, setStyle, setVariation
public FileSystemResourceStream(Path path)
path
- Path
containing resourcepublic FileSystemResourceStream(File file)
file
- File
containing resourcepublic InputStream getInputStream() throws ResourceStreamNotFoundException
IResourceStream
getInputStream
in interface IResourceStream
ResourceStreamNotFoundException
IResourceStream.close()
public void close() throws IOException
IResourceStream
close
in interface Closeable
close
in interface AutoCloseable
close
in interface IResourceStream
IOException
public String getContentType()
IResourceStream
getContentType
in interface IResourceStream
getContentType
in class AbstractResourceStream
public final Path getPath()
public Time lastModifiedTime()
IModifiable
lastModifiedTime
in interface IModifiable
lastModifiedTime
in class AbstractResourceStream
Time
or
null
if that information is not availablepublic Bytes length()
IResourceStream
length
in interface IResourceStream
length
in class AbstractResourceStream
null
if unknownpublic String locationAsString()
locationAsString
in interface IFixedLocationResourceStream
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.