Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed Mar 1, 2024
1 parent 655221e commit f4944e1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,25 @@ from project.System.File.Generic.File_Write_Strategy import generic_copy
from project.System.File_Format import Auto_Detect, Bytes, File_Format, Plain_Text_Format

type Enso_File
## Resolves an `enso://` path to a file.
new : Text -> Enso_File
## Resolves an `enso://` path and returns the corresponding `Enso_File`
instance.

Arguments:
- path: The `enso://` path to a file or directory.

? Enso Cloud Paths

The paths consist of the organization (user) name followed by a path to
the file/directory delimited by `/`.
For example `enso://my_org/some_dir/some-file.txt`.

! Work in progress - only existing resources

Currently the API is only able to resolve paths to existing files or
directories. This is a temporary limitation and it will be improved in
the future, alongside with implementing the capabilities to write new
files.
new : Text -> Enso_File ! Not_Found
new (path : Text) =
parsed = Enso_Path.parse path
parent = parsed.resolve_parent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

import org.enso.base.file_system.FileSystemSPI;

/** Registers the `enso://` protocol for resolving file paths.
* <p>
* See `Enso_File.new` for more information on path resolution.
*/
@org.openide.util.lookup.ServiceProvider(service = FileSystemSPI.class)
public class EnsoPathFileSystemSPI extends FileSystemSPI {
@Override
Expand Down

0 comments on commit f4944e1

Please sign in to comment.