|
@@ -2,6 +2,7 @@ package com.miniframe.tools;
|
|
|
|
|
|
import com.google.common.io.Resources;
|
|
import com.google.common.io.Resources;
|
|
import com.miniframe.constant.MFConstant;
|
|
import com.miniframe.constant.MFConstant;
|
|
|
|
+import com.miniframe.core.IniFileReader;
|
|
import com.miniframe.core.ext.UtilTools;
|
|
import com.miniframe.core.ext.UtilTools;
|
|
import com.miniframe.generate.appcode.FileType;
|
|
import com.miniframe.generate.appcode.FileType;
|
|
import com.miniframe.model.system.SysFile;
|
|
import com.miniframe.model.system.SysFile;
|
|
@@ -43,40 +44,45 @@ public class XIFileUtils {
|
|
// fileRootPathStr =Paths.get(pathStr).toString().replace("\\", XIConfig.separator)+XIConfig.separator;
|
|
// fileRootPathStr =Paths.get(pathStr).toString().replace("\\", XIConfig.separator)+XIConfig.separator;
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
- Path path = Paths.get("e:/opt/files/a/b/c/d/1111.mp4");
|
|
|
|
- getRelativizePathStr("/opt/files/device.rar");
|
|
|
|
-
|
|
|
|
- getAbsolutePathStr("/1/opt/files/device.rar");
|
|
|
|
-
|
|
|
|
- String fileName = path.getFileName().toString();
|
|
|
|
-
|
|
|
|
- String md5 = XIUtils.getMD5(fileName);
|
|
|
|
- String first = md5.substring(0, 2);//第一级目录
|
|
|
|
- String second = md5.substring(2, 4);//第二级目录
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- String pathTo = getFilePathStr("group", first, second, fileName);
|
|
|
|
-
|
|
|
|
- try {
|
|
|
|
- InputStream inputStream = Files.newInputStream(Paths.get("/opt/files/890adbc8ba984e429464fe782e4fa3e9-1e66ddc664aa43958b690c8c46cdd364_20210203102343.aac"));
|
|
|
|
- } catch (IOException e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- String mimeType = MFMimeTypeUtils.getMimeType("/opt/files/890adbc8ba984e429464fe782e4fa3e9-1e66ddc664aa43958b690c8c46cdd364_20210203102343.aac");
|
|
|
|
-
|
|
|
|
- ContentType contentType = ContentType.create(mimeType);
|
|
|
|
-
|
|
|
|
- String suffix = getExtensionWithDot("e:/1/2/3\\5/5.mp4");
|
|
|
|
|
|
+// Path path = Paths.get("e:/opt/files/a/b/c/d/1111.mp4");
|
|
|
|
+// getRelativizePathStr("/opt/files/device.rar");
|
|
|
|
+//
|
|
|
|
+// getAbsolutePathStr("/1/opt/files/device.rar");
|
|
|
|
+//
|
|
|
|
+// String fileName = path.getFileName().toString();
|
|
|
|
+//
|
|
|
|
+// String md5 = XIUtils.getMD5(fileName);
|
|
|
|
+// String first = md5.substring(0, 2);//第一级目录
|
|
|
|
+// String second = md5.substring(2, 4);//第二级目录
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// String pathTo = getFilePathStr("group", first, second, fileName);
|
|
|
|
+//
|
|
|
|
+// try {
|
|
|
|
+// InputStream inputStream = Files.newInputStream(Paths.get("/opt/files/890adbc8ba984e429464fe782e4fa3e9-1e66ddc664aa43958b690c8c46cdd364_20210203102343.aac"));
|
|
|
|
+// } catch (IOException e) {
|
|
|
|
+// e.printStackTrace();
|
|
|
|
+// }
|
|
|
|
+// String mimeType = MFMimeTypeUtils.getMimeType("/opt/files/890adbc8ba984e429464fe782e4fa3e9-1e66ddc664aa43958b690c8c46cdd364_20210203102343.aac");
|
|
|
|
+//
|
|
|
|
+// ContentType contentType = ContentType.create(mimeType);
|
|
|
|
+//
|
|
|
|
+// String suffix = getExtensionWithDot("e:/1/2/3\\5/5.mp4");
|
|
|
|
+//
|
|
|
|
+// String uuid = UtilTools.getUUid();
|
|
|
|
+// String uploadDirStr = "/opt/files/";
|
|
|
|
+// for (int i = 0; i < 2; i++) {
|
|
|
|
+// uploadDirStr += uuid.substring(i * 2, i * 2 + 2) + "/";
|
|
|
|
+// }
|
|
|
|
+// int x = 0;
|
|
|
|
|
|
- String uuid = UtilTools.getUUid();
|
|
|
|
- String uploadDirStr = "/opt/files/";
|
|
|
|
- for (int i = 0; i < 2; i++) {
|
|
|
|
- uploadDirStr += uuid.substring(i * 2, i * 2 + 2) + "/";
|
|
|
|
- }
|
|
|
|
- int x = 0;
|
|
|
|
|
|
+ IniFileReader ini = new IniFileReader("userconfig/user.properties");
|
|
|
|
+ String host = ini.getStrValue("es.host")+"/searchAllLog";
|
|
|
|
+ System.out.println(host);
|
|
}
|
|
}
|
|
|
|
|
|
public static String getRelativizePathStr(Path path) {
|
|
public static String getRelativizePathStr(Path path) {
|