|
PageMixer API - 3.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jp.ne.dti.lares.foozy.pagemixer.page.LocalFSLocator
Locate resource on local file system.
This gets InputStream
of resource
from local file system.
This uses File#lastModified
to get and examine timestamp of resource,
so this gives you chance to decide whether re-read it or not,
if it is modified after last your reading in.
You should use ClassLoaderLocator
if you want to use resource included in JAR file.
Constructor Summary | |
LocalFSLocator()
Create locator to locate resource current directory relatively. |
|
LocalFSLocator(java.lang.String basePath)
Create locator to locate resource specified directory relatively. |
Method Summary | |
void |
close(java.lang.Object descriptor)
There is nothing to do. |
java.io.InputStream |
getInputStream(java.lang.Object descriptor)
Get InputStream by creating FileInputStream . |
long |
getLastModified(java.lang.Object descriptor)
Get last modified timestamp by File#lastModified . |
boolean |
isNewerThan(java.lang.Object descriptor,
long timestamp)
Examine with File#lastModified . |
java.lang.Object |
open(java.lang.String id)
Returns File object corresponded to given id. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LocalFSLocator()
This is equivalent with
LocalFSLocator(".")
.
public LocalFSLocator(java.lang.String basePath)
basePath
- Method Detail |
public java.lang.Object open(java.lang.String id)
File
object corresponded to given id.open
in interface Locator
jp.ne.dti.lares.foozy.pagemixer.page.Locator
id
- to identify resourcejava.io.IOException
- fail to create descriptorpublic void close(java.lang.Object descriptor)
close
in interface Locator
jp.ne.dti.lares.foozy.pagemixer.page.Locator
descriptor
- for resourcejava.io.IOException
- fail to discard descriptorpublic long getLastModified(java.lang.Object descriptor)
File#lastModified
.getLastModified
in interface Locator
jp.ne.dti.lares.foozy.pagemixer.page.Locator
descriptor
- ,implementation specificjava.io.IOException
- fail to get last modified timestamppublic boolean isNewerThan(java.lang.Object descriptor, long timestamp)
File#lastModified
.isNewerThan
in interface Locator
jp.ne.dti.lares.foozy.pagemixer.page.Locator
descriptor
- ,implementation specificjava.io.IOException
- fail to comparepublic java.io.InputStream getInputStream(java.lang.Object descriptor) throws java.io.IOException
FileInputStream
.getInputStream
in interface Locator
jp.ne.dti.lares.foozy.pagemixer.page.Locator
descriptor
- ,implementation specificjava.io.IOException
- fail to create stream
|
PageMixer API - 3.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |