Implement plugin interface in mobile app
This commit is contained in:
@@ -31,7 +31,6 @@ object Executable {
|
||||
}
|
||||
|
||||
object ConfigUtils {
|
||||
val SHADOWSOCKS = "{\"server\": \"%s\", \"server_port\": %d, \"local_port\": %d, \"password\": \"%s\", \"method\":\"%s\", \"timeout\": %d}"
|
||||
val REDSOCKS = "base {\n" +
|
||||
" log_debug = off;\n" +
|
||||
" log_info = off;\n" +
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
package com.github.shadowsocks.utils
|
||||
|
||||
import com.github.shadowsocks.utils.CloseUtils._
|
||||
import java.io.{FileWriter, InputStream, OutputStream}
|
||||
import java.io._
|
||||
|
||||
/**
|
||||
* @author Mygod
|
||||
@@ -39,4 +39,10 @@ object IOUtils {
|
||||
|
||||
def writeString(file: String, content: String): Unit =
|
||||
autoClose(new FileWriter(file))(writer => writer.write(content))
|
||||
|
||||
@throws[FileNotFoundException]
|
||||
def deleteRecursively(file: File) {
|
||||
if (file.isDirectory) file.listFiles().foreach(deleteRecursively)
|
||||
if (!file.delete()) throw new FileNotFoundException("Failed to delete: " + file.getAbsolutePath)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user