|
@@ -6,6 +6,7 @@ import com.fdkankan.fusion.common.FilePath;
|
|
import com.fdkankan.fusion.common.ResultCode;
|
|
import com.fdkankan.fusion.common.ResultCode;
|
|
import com.fdkankan.fusion.exception.BusinessException;
|
|
import com.fdkankan.fusion.exception.BusinessException;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.omg.CosNaming.NamingContextExtPackage.StringNameHelper;
|
|
|
|
|
|
import java.io.*;
|
|
import java.io.*;
|
|
import java.util.LinkedHashSet;
|
|
import java.util.LinkedHashSet;
|
|
@@ -127,12 +128,24 @@ public class OBJToGLBUtil {
|
|
return file;
|
|
return file;
|
|
}
|
|
}
|
|
|
|
|
|
- public static String OsgbToB3dm(File objPathFile,Integer modelId) {
|
|
|
|
- String targetPath = FilePath.MNT_BASE_PATH +"osgb" +"/" + modelId +"/" + objPathFile.getName();
|
|
|
|
- String sourcePath = FilePath.MNT_BASE_PATH +"b3dm" +"/" + modelId +"/" + objPathFile.getName();
|
|
|
|
|
|
+ public static String OsgbToB3dm(File objPathFile) {
|
|
|
|
+ String targetPath = FilePath.MNT_BASE_PATH +"osgb" +"/" + objPathFile.getName();
|
|
|
|
+ String sourcePath = FilePath.MNT_BASE_PATH +"b3dm" +"/" + objPathFile.getName();
|
|
|
|
|
|
//ShellUtil.execCmd("cp -r " + objPath + " " + dockerPath+ objPathFile.getName() );
|
|
//ShellUtil.execCmd("cp -r " + objPath + " " + dockerPath+ objPathFile.getName() );
|
|
- FileUtil.copyContent(objPathFile,new File(targetPath),true);
|
|
|
|
|
|
+ File file = new File(targetPath);
|
|
|
|
+ FileUtil.copyContent(objPathFile,file,true);
|
|
|
|
+ String dirName = "";
|
|
|
|
+ if(file.exists()){
|
|
|
|
+ File[] files = file.listFiles();
|
|
|
|
+ for (File file1 : files) {
|
|
|
|
+ if(file1.isDirectory()){
|
|
|
|
+ dirName = file1.getName();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ targetPath +="/" + dirName;
|
|
|
|
+ sourcePath +="/" + dirName;
|
|
|
|
|
|
String cmd = ShellCmd.osgbTob3dmCmd.replaceAll("@path",FilePath.MNT_BASE_PATH);
|
|
String cmd = ShellCmd.osgbTob3dmCmd.replaceAll("@path",FilePath.MNT_BASE_PATH);
|
|
cmd =cmd.replaceAll("@inputFile",targetPath);
|
|
cmd =cmd.replaceAll("@inputFile",targetPath);
|