Package com.helger.commons.io.relative
Interface IPathRelativeIO
-
- All Known Subinterfaces:
IFileRelativeIO
- All Known Implementing Classes:
FileRelativeIO,PathRelativeIO
public interface IPathRelativeIOA read-only version of a path-relative IO component.- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StringgetBasePath()default InputStreamgetInputStream(String sRelativePath)Get theInputStreamrelative to the base pathdefault ReadergetReader(String sRelativePath, Charset aCharset)Get theReaderrelative to the base pathIReadableResourcegetResource(String sRelativePath)Get the file system resource relative to the base path.
-
-
-
Method Detail
-
getBasePath
@Nonnull @Nonempty String getBasePath()
- Returns:
- The base path. May be a file path, a URL or whatever. Never
null.
-
getResource
@Nonnull IReadableResource getResource(@Nonnull String sRelativePath)
Get the file system resource relative to the base path. This method CAN NOT handle absolute paths!- Parameters:
sRelativePath- the relative path- Returns:
- The "absolute"
IReadableResourceand nevernull.
-
getInputStream
@Nullable default InputStream getInputStream(@Nonnull String sRelativePath)
Get theInputStreamrelative to the base path- Parameters:
sRelativePath- the relative path- Returns:
nullif the path does not exist
-
-