trait FileDescriptor extends AnyRef
A representation of a file stored in an arbitrary location. A descriptor includes logic to copy files to and from a local filesystem, as well as filesystem navigation logic.
- Alphabetic
- By Inheritance
- FileDescriptor
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
child(name: String): FileDescriptor
Adds a new child node to the filesystem path.
Adds a new child node to the filesystem path.
- name
the node name.
- returns
the new file descriptor with the updated path
-
abstract
def
delete(): Boolean
Deletes the file associated with the file descriptor
Deletes the file associated with the file descriptor
- returns
trueif the delete was successful,falseotherwise.
-
abstract
def
download(localTarget: LocalFileDescriptor, safeDownloading: Boolean = false): Boolean
Downloads the file to the given local destination.
Downloads the file to the given local destination. Both the source and the destination must point to a file.
- localTarget
the local destination to which this file should be downloaded. The path must be absolute path to the final file.
- safeDownloading
downloads the file to filename + ".tmp" and renames it to the original name if the download was successful.
- returns
trueif the download was successful,falseotherwise.
-
abstract
def
exists: Boolean
Returns true if the file pointed by the file descriptor exists
Returns true if the file pointed by the file descriptor exists
- returns
true if the file pointed by the file descriptor exists
-
abstract
def
isDirectory: Boolean
Returns true if the fd points to a directory
Returns true if the fd points to a directory
- returns
true if the fd points to a directory
-
abstract
def
list: Iterator[FileDescriptor]
Lists the files in the current file descriptor directory
Lists the files in the current file descriptor directory
- returns
a iterator of file descriptors
-
abstract
def
listAllFilesWithPrefix(prefix: String): Iterator[FileDescriptor]
Lists all files down the file hierarchy tree that whose relative path match the given prefix
Lists all files down the file hierarchy tree that whose relative path match the given prefix
- prefix
the prefix to match given each file relative path to the current directory
- returns
a iterator of file descriptors
-
abstract
def
mkdirs(): Boolean
Creates intermediary directories
Creates intermediary directories
- returns
true if the creation of successful, false otherwise.
-
abstract
def
name: String
The name of the file associated with the file descriptor.
The name of the file associated with the file descriptor.
- returns
the file name.
-
abstract
def
parent(n: Int = 1): FileDescriptor
Returns the file descriptor
nnode up in the filesystem path.Returns the file descriptor
nnode up in the filesystem path.- n
the number of parent nodes to go back.
- returns
the file descriptor
nnode up in the filesystem path.
-
abstract
def
path: String
Returns the unique identifier of this file in its location.
Returns the unique identifier of this file in its location.
- returns
the unique identifier of this file in its location.
-
abstract
def
size: Long
The size of the file associated with the file descriptor.
-
abstract
def
stream(): InputStream
Returns an input stream for the contents of this file.
Returns an input stream for the contents of this file.
- returns
an input stream for the contents of this file.
-
abstract
def
upload(inputStream: InputStream, length: Option[Long]): Boolean
Uploads an input stream to this file's location.
Uploads an input stream to this file's location. The target must point to a file.
- inputStream
the input stream that should be uploaded.
- length
the input stream length (leaving this as
Nonecan have performance implications)- returns
trueif the upload was successful,falseotherwise.
-
abstract
def
upload(localTarget: LocalFileDescriptor): Boolean
Uploads a local file to this file's location.
Uploads a local file to this file's location. Both the source and the target must point to a file.
- localTarget
the local file that should be uploaded. The path must be absolute path to the final file.
- returns
trueif the upload was successful,falseotherwise.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
/(name: String): FileDescriptor
Adds a new child node to the filesystem path.
Adds a new child node to the filesystem path.
- name
the node name.
- returns
the new file descriptor with the updated path
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
cd(pathString: String): FileDescriptor
Changes the path of the file descriptor using unix's cd syntax related to the current directory.
Changes the path of the file descriptor using unix's cd syntax related to the current directory. Ex: Go back to directories: ../.. Go to child directories: foo/bar Go to sibling directory: ../foo Absolute path changes are not supported.
- pathString
the cd command
- returns
the new file descriptor with the updated path
-
def
children(names: String*): FileDescriptor
Adds multiple new child nodes to the filesystem path.
Adds multiple new child nodes to the filesystem path.
- names
the node names to add.
- returns
the new file descriptor with the updated path
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
lines(): Iterator[String]
Returns an iterator with the lines of this file.
Returns an iterator with the lines of this file.
- returns
an iterator with the lines of this file.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
sibling(f: (String) ⇒ String): FileDescriptor
Returns a new file descriptor pointing to a sibling of the current file descriptor
Returns a new file descriptor pointing to a sibling of the current file descriptor
- f
a function that returns a new name from the current name of the file descriptor
- returns
a new file descriptor pointing to a sibling of the current file descriptor
-
def
sibling(name: String): FileDescriptor
Returns a new file descriptor pointing to a sibling of the current file descriptor
Returns a new file descriptor pointing to a sibling of the current file descriptor
- name
the file name of the new file descriptor
- returns
a new file descriptor pointing to a sibling of the current file descriptor
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )