|
2 | 2 |
|
3 | 3 | import static com.ss.editor.extension.property.EditablePropertyType.*; |
4 | 4 | import static com.ss.editor.util.EditorUtil.getAssetFile; |
| 5 | +import static com.ss.editor.util.EditorUtil.getRealFile; |
5 | 6 | import static com.ss.editor.util.EditorUtil.toAssetPath; |
6 | 7 | import static com.ss.rlib.util.FileUtils.containsExtensions; |
7 | 8 | import static com.ss.rlib.util.ObjectUtils.notNull; |
@@ -71,7 +72,7 @@ public void convert(@NotNull final Path source, @NotNull final Path destination) |
71 | 72 | } |
72 | 73 |
|
73 | 74 | final String resultName = FileUtils.getNameWithoutExtension(source); |
74 | | - final Path assetDestination = EditorUtil.getAssetFile(destination); |
| 75 | + final Path assetDestination = getAssetFile(destination.getParent()); |
75 | 76 |
|
76 | 77 | final Array<PropertyDefinition> definitions = ArrayFactory.newArray(PropertyDefinition.class); |
77 | 78 | definitions.add(new PropertyDefinition(STRING, Messages.MODEL_CONVERTER_DIALOG_RESULT_NAME, PROP_RESULT_NAME, resultName)); |
@@ -135,7 +136,7 @@ private void convert(@NotNull final Path source, @NotNull final VarTable vars) { |
135 | 136 | private void convertImpl(@NotNull final Path source, @NotNull final VarTable vars) throws IOException { |
136 | 137 |
|
137 | 138 | final String filename = vars.getString(PROP_RESULT_NAME); |
138 | | - final Path destinationFolder = vars.get(PROP_DESTINATION); |
| 139 | + final Path destinationFolder = notNull(getRealFile(vars.get(PROP_DESTINATION, Path.class))); |
139 | 140 | final Path destination = destinationFolder.resolve(filename + "." + FileExtensions.JME_OBJECT); |
140 | 141 | final boolean isOverwrite = Files.exists(destination); |
141 | 142 |
|
|
0 commit comments