Skip to content

Commit

Permalink
324 - fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
regis-leray committed Aug 7, 2023
1 parent f461d9a commit 10289b8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions zio-ftp/src/main/scala/zio/ftp/FtpSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,14 @@ object KeyFileSftpIdentity {
KeyFileSftpIdentity(privateKey, None)
}


sealed abstract class ProtectionLevel(val s: String)
object ProtectionLevel{
final case object Clear extends ProtectionLevel("C")

object ProtectionLevel {
final case object Clear extends ProtectionLevel("C")
final case object Private extends ProtectionLevel("P")
}

/**
*
* @param isImplicit // security mode (Implicit/Explicit)
* @param pbzs // Protection Buffer SiZe default value 0
* @param prot // data channel PROTection level default value C
Expand All @@ -142,7 +141,7 @@ object ProtectionLevel{
*/
final case class SslParams(isImplicit: Boolean, pbzs: Long, prot: ProtectionLevel)

object SslParams{
object SslParams {
val default: SslParams = SslParams(false, 0L, ProtectionLevel.Clear)
}

Expand Down
2 changes: 1 addition & 1 deletion zio-ftp/src/main/scala/zio/ftp/UnsecureFtp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ object UnsecureFtp {
def connect(settings: UnsecureFtpSettings): ZIO[Scope, ConnectionError, FtpAccessors[Client]] =
acquireRelease(
attemptBlockingIO {
val ftpClient = settings.sslParams.fold(new JFTPClient()){ ssl =>
val ftpClient = settings.sslParams.fold(new JFTPClient()) { ssl =>
val c = new JFTPSClient(ssl.isImplicit)
c.execPBSZ(ssl.pbzs)
c.execPROT(ssl.prot.s)
Expand Down
2 changes: 1 addition & 1 deletion zio-ftp/src/test/scala/zio/ftp/SecureFtpSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ object SecureFtpSpec extends ZIOSpecDefault {
val settings = SecureFtpSettings("127.0.0.1", port = 2222, FtpCredentials("foo", "foo"))

val home = Paths.get("ftp-home/sftp/home/foo")

override def spec: Spec[TestEnvironment & Scope, Any] =
suite("SecureFtpSpec")(
test("invalid credentials")(
Expand Down

0 comments on commit 10289b8

Please sign in to comment.