trait Path extends AnyRef
Open trait for path abstraction.
- Alphabetic
- By Inheritance
- Path
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def fileName: Option[String]
Returns name of the file pointed by this path.
Returns name of the file pointed by this path.
Given path pointing to a local file in /root/dir1/dir2/file with root == "root": val p: Path = ??? p.fileName == Some("file")
, File 'gs://bucket/this/is/flat/name/' in underlying storage has flat name "this/is/flat/name/". This would be represented as Path: val p: Path = ??? p.pathFromRoot == List("this", "is", "flat", "name") p.fileName == None p.isDir == Some(true)
- Note
Some blob stores (s3, gcs) having flat namespaces allow trailing slashes in file names.
- See also
Examples: - abstract def isDir: Option[Boolean]
If known returns true if path points to a directory, otherwise – false.
If known returns true if path points to a directory, otherwise – false. It's not always possible to know from string representation whether path points to directory or file ending with trailing slash. Paths returned by blobstore.Store.list must have this field defined.
Given path pointing to a local file in /root/dir1/dir2/file with root == "root": val p: Path = ??? p.isDir == Some(false)
, Given path pointing to a local directory in /root/dir1/dir2/dir/ with root == "root": val p: Path = ??? p.isDir == Some(true)
, Given path pointing to object in S3 bucket 's3://bucket/this/is/flat/name/': val p: Path = ??? p.isDire = Some(false)
, Given path created from String: val p: Path = ??? p.isDir == None
Examples: - abstract def lastModified: Option[Instant]
Returns most recent time when file pointed by this path has been modified if known.
- abstract def pathFromRoot: Chain[String]
Returns names of directories along the path to the item, starting at the root.
Returns names of directories along the path to the item, starting at the root.
Given path pointing to a local file in /root/dir1/dir2/file with root == "root": val p: Path = ??? p.pathFromRoot == List("dir1", "dir2")
, Given path pointing to a local directory in /root/dir1/dir2/dir/ with root == "root": val p: Path = ??? p.pathFromRoot == List("dir1", "dir2", "dir")
Examples: - abstract def root: Option[String]
Returns optional root of this path.
Returns optional root of this path. It might be bucket name or specific directory to which it is necessary to restrict access to.
Given path pointing inside S3 bucket 'bucket': val p: Path = ??? p.root == Some("bucket")
Example: - abstract def size: Option[Long]
Returns size in bytes of the file pointed by this path if known.
Returns size in bytes of the file pointed by this path if known. For directories always return None.
Given path pointing to a local 20 byte file: val p: Path = ??? p.size = Some(20)
Example:
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(obj: Any): Boolean
- Definition Classes
- Path → AnyRef → Any
- Annotations
- @SuppressWarnings()
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- Path → AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def withFileName(newFileName: Option[String], reset: Boolean = true): Path
Returns path with fileName field set to provided value.
- def withIsDir(newIsDir: Option[Boolean], reset: Boolean = true): Path
Returns path with isDir field set to provided value.
Returns path with isDir field set to provided value.
- newIsDir
- value to be set as isDir.
- reset
- when true fields size and lastModified in returned object would be set to None, otherwise kept the same.
- returns
new Path with isDir field set to provided param.
- def withLastModified(newLastModified: Option[Instant], reset: Boolean = true): Path
Returns path with lastModified field set to provided value.
Returns path with lastModified field set to provided value.
- newLastModified
- value to be set as lastModified.
- reset
- when true fields size and isDir in returned object would be set to None, otherwise kept the same.
- returns
new Path with lastModified field set to provided param.
- def withPathFromRoot(newPathFromRoot: Chain[String], reset: Boolean = true): Path
Returns path with pathFromRoot field set to provided value.
Returns path with pathFromRoot field set to provided value.
- newPathFromRoot
- value to be set as pathFromRoot.
- reset
- when true fields isDir, size and lastModified in returned object would be set to None, otherwise kept the same.
- returns
new Path with pathFromRoot field set to provided param.
- def withRoot(newRoot: Option[String], reset: Boolean = true): Path
Returns path with root field set to provided value.
- def withSize(newSize: Option[Long], reset: Boolean = true): Path
Returns path with size field set to provided value.
Returns path with size field set to provided value.
- newSize
- value to be set as size.
- reset
- when true fields isDir and lastModified in returned object would be set to None, otherwise kept the same.
- returns
new Path with size field set to provided param.