← ZIO Ftp docs

FtpAccessors

zio.ftp.FtpAccessors
trait FtpAccessors[+A]

Attributes

Source
FtpAccessors.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class SecureFtp
class UnsecureFtp

Members list

Value members

Abstract methods

def execute[T](f: A => T): ZIO[Any, IOException, T]

Lift unsafe operation that does blocking IO into a ZIO effect. If the operation failed an error will be emitted

Lift unsafe operation that does blocking IO into a ZIO effect. If the operation failed an error will be emitted

Type parameters

T

return value

Value parameters

f

unsafe function to lift

Attributes

Source
FtpAccessors.scala
def ls(path: String): ZStream[Any, IOException, FtpResource]

List of files / directories. If the operation failed, an error will be emitted

List of files / directories. If the operation failed, an error will be emitted

Value parameters

path

absolute path of the directory

Attributes

Source
FtpAccessors.scala
def lsDescendant(path: String): ZStream[Any, IOException, FtpResource]

List of files from a base directory recursively. If the operation failed, an error will be emitted

List of files from a base directory recursively. If the operation failed, an error will be emitted

Value parameters

path

absolute path of the directory

Attributes

Source
FtpAccessors.scala
def mkdir(path: String): ZIO[Any, IOException, Unit]

Create a directory. If the operation failed, an error will be emitted

Create a directory. If the operation failed, an error will be emitted

Value parameters

path

absolute path of the directory

Attributes

Source
FtpAccessors.scala
def readFile(path: String, chunkSize: Int, fileOffset: Long): ZStream[Any, IOException, Byte]

Read a file by using stream. If the operation failed, an error will be emitted

Read a file by using stream. If the operation failed, an error will be emitted

Value parameters

chunkSize

default chunk size is 2048 bytes

fileOffset

optional initial offset in bytes

path

absolute path of a file

Attributes

Source
FtpAccessors.scala
def rename(oldPath: String, newPath: String): ZIO[Any, IOException, Unit]

Renames a file/directory. If the operation failed, an error will be emitted

Renames a file/directory. If the operation failed, an error will be emitted

Value parameters

newPath

absolute path of the file/directory destination.

oldPath

absolute path of the file/directory to rename

Attributes

Source
FtpAccessors.scala
def rm(path: String): ZIO[Any, IOException, Unit]

Delete a file on a server. If the operation failed, an error will be emitted

Delete a file on a server. If the operation failed, an error will be emitted

Value parameters

path

absolute path of the file

Attributes

Source
FtpAccessors.scala
def rmdir(path: String): ZIO[Any, IOException, Unit]

Delete a directory. If the operation failed, an error will be emitted

Delete a directory. If the operation failed, an error will be emitted

Value parameters

path

absolute path of the directory

Attributes

Source
FtpAccessors.scala
def stat(path: String): ZIO[Any, IOException, Option[FtpResource]]

Check existence of a file. If the file doesn't exist, the operation will succeed by returning an empty ftp resource If the operation failed an error will be emitted

Check existence of a file. If the file doesn't exist, the operation will succeed by returning an empty ftp resource If the operation failed an error will be emitted

Value parameters

path

absolute path of the file

Attributes

Source
FtpAccessors.scala
def upload[R](path: String, source: ZStream[R, Throwable, Byte]): ZIO[R, IOException, Unit]

Save a data stream. If the operation failed, an error will be emitted

Save a data stream. If the operation failed, an error will be emitted

Type parameters

R

environment required by the specified stream source. The upload itself needs no extra environment

Value parameters

path

absolute path of file to store

source

data stream to store

Attributes

Source
FtpAccessors.scala