diff --git a/app/src/main/java/com/common/commonlibtest/MainActivity.java b/app/src/main/java/com/common/commonlibtest/MainActivity.java index c681af4..ec323b0 100644 --- a/app/src/main/java/com/common/commonlibtest/MainActivity.java +++ b/app/src/main/java/com/common/commonlibtest/MainActivity.java @@ -11,6 +11,8 @@ import com.common.commonlib.image.loader.ImageLoader; import com.common.commonlib.net.RequestCallBack; import com.common.commonlib.net.interceptor.RequestHeadInterceptor; import com.common.commonlib.net.interceptor.ResponseHeadInterceptor; +import com.common.commonlib.utils.BaseUtils; +import com.common.commonlib.utils.FTPUtils; import com.common.commonlibtest.bean.ArticlesResponse; import com.common.commonlibtest.bean.CollectionResponse; import com.common.commonlibtest.bean.LoginResponse; @@ -118,5 +120,18 @@ public class MainActivity extends AppCompatActivity { } }); }); + + binding.uploadBtn.setOnClickListener(l -> { + String filePath = BaseUtils.INSTANCE.getExternalStorageDirectory(this); + String fileName = "/richang.md"; + Thread thread = new Thread(new Runnable() { + @Override + public void run() { + FTPUtils.RESULT result = FTPUtils.INSTANCE.ftpUpload("192.168.101.215", "2221", "admin", "123456", filePath, fileName); + Log.i("wangym", result.name()); + } + }); + thread.start(); + }); } } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 383b4a4..6f868b0 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -60,4 +60,15 @@ app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.770" /> +