Class ResourceMgr
java.lang.Object
org.aksw.commons.util.lifecycle.ResourceMgr
- All Implemented Interfaces:
AutoCloseable
A class where resources can be added.
Upon closing the resource manager, all registered resources will be freed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static PathbooleanisClosed()<T extends AutoCloseable>
Tregister(T closable) <T> Tregister(T obj, FinallyRunAll.ThrowingConsumer<? super T> closer) <T> Tregister(T obj, ThrowingRunnable closeAction) If the resource manager has already been closed then resources are immediately closed upon registration.static PathtoPath(ResourceMgr resourceMgr, Class<?> clz, String classPath) Create a path and register the filesystem with the resource manager.static PathtoPath(ResourceMgr resourceMgr, URI uri) Create a path and register the filesystem with the resource manager.static PathtoPath(ResourceMgr resourceMgr, URL url) Create a path and register the filesystem with the resource manager.
-
Constructor Details
-
ResourceMgr
public ResourceMgr()
-
-
Method Details
-
register
-
register
-
register
If the resource manager has already been closed then resources are immediately closed upon registration. -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
isClosed
public boolean isClosed() -
toPath
public static Path toPath(ResourceMgr resourceMgr, Class<?> clz, String classPath) throws IOException Create a path and register the filesystem with the resource manager.- Throws:
IOException
-
toPath
Create a path and register the filesystem with the resource manager.- Throws:
IOException
-
toPath
Create a path and register the filesystem with the resource manager.- Throws:
IOException
-
fixPath
-