Package ru.curs.celesta.score.io
Class FileResource
java.lang.Object
ru.curs.celesta.score.io.FileResource
- All Implemented Interfaces:
Resource
Score resource located in the file system.
- Since:
- 2019-02-23
- Author:
- Pavel Perminov (packpaul@mail.ru)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if the passed-in resource is a child ofthisresource.createRelative(String relativePath, Namespace namespace) Creates a resource relative to this resource.booleandelete()Deletes physical resource thatthisresource points at.booleanReturns input stream for the resource.Returns namespace of current resource.Returns output stream for the resource if it is writable,nullotherwise.getRelativePath(Resource childResource) Returns relative path fromthisresource to the child one, ornullif such path doesn't exist.inthashCode()toString()Methods inherited from interface ru.curs.celesta.score.io.Resource
createRelative, createRelative
-
Constructor Details
-
FileResource
-
FileResource
-
-
Method Details
-
getInputStream
Description copied from interface:ResourceReturns input stream for the resource.- Specified by:
getInputStreamin interfaceResource- Returns:
- Throws:
IOException- when input stream cannot be provided.
-
getOutputStream
Description copied from interface:ResourceReturns output stream for the resource if it is writable,nullotherwise.- Specified by:
getOutputStreamin interfaceResource- Returns:
- Throws:
IOException- when output stream cannot be provided.
-
delete
Description copied from interface:ResourceDeletes physical resource thatthisresource points at.- Specified by:
deletein interfaceResource- Returns:
trueif successfully deleted orfalseotherwise.- Throws:
IOException- when an error happened during deletion.
-
contains
Description copied from interface:ResourceChecks if the passed-in resource is a child ofthisresource. -
getRelativePath
Description copied from interface:ResourceReturns relative path fromthisresource to the child one, ornullif such path doesn't exist.- Specified by:
getRelativePathin interfaceResource- Parameters:
childResource- child resource ofthisresource.- Returns:
-
createRelative
Description copied from interface:ResourceCreates a resource relative to this resource.- Specified by:
createRelativein interfaceResource- Parameters:
relativePath- path relative tothisresource.namespace- name space of the created resource.- Returns:
-
getNamespace
Description copied from interface:ResourceReturns namespace of current resource.- Specified by:
getNamespacein interfaceResource- Returns:
-
toString
-
hashCode
public int hashCode() -
equals
-