Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
*/
package io.github.ascopes.jct.workspaces;

import io.github.ascopes.jct.workspaces.impl.RamDirectoryImpl;
import java.net.URI;
import java.net.URL;
import java.nio.file.FileSystem;
import java.nio.file.Path;
import org.apiguardian.api.API;
import org.apiguardian.api.API.Status;
Expand All @@ -27,14 +25,8 @@
/**
* A path-like object that can provide a {@link Path Java NIO Path}.
*
* <p>Not only does this enable us to have different types of path with varying behaviour, but
* we can also use this to enforce that other references related to the internal path are kept alive
* for as long as the path-like object itself is kept alive.
*
* <p>This becomes very useful for {@link RamDirectoryImpl}, which keeps a RAM-based
* {@link FileSystem} alive until it is garbage collected, or the {@link RamDirectoryImpl#close()}
* operation is called. The mechanism enables cleaning up of resources implicitly without
* resource-tidying logic polluting the user's test cases.
* <p>This enables wrapping various implementations and providers of {@link Path} objects
* in a translucent façade that enables representing paths in a hierarchical format.
*
* @author Ashley Scopes
* @since 0.0.1
Expand Down Expand Up @@ -65,20 +57,26 @@ public interface PathRoot {
* Get the {@link Path Java NIO Path} for this path-like object.
*
* @return the path.
* @see #getUri()
* @see #getUrl()
*/
Path getPath();

/**
* Get a URI representation of this path-like object.
*
* @return the URI.
* @see #getUrl()
* @see #getPath()
*/
URI getUri();

/**
* Get a URL representation of this path-like object.
*
* @return the URL.
* @see #getUri()
* @see #getPath()
*/
URL getUrl();

Expand Down