Skip to content

Commit 3f408d8

Browse files
committed
FISH-6772 : without random Number
1 parent 5ef2551 commit 3f408d8

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

  • bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/handlers

bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/handlers/MigrateHandler.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import java.io.IOException;
1515
import java.io.InputStreamReader;
1616
import java.nio.file.Files;
17+
import java.nio.file.Path;
1718
import java.nio.file.Paths;
1819
import java.util.ArrayList;
1920
import java.util.List;
@@ -42,7 +43,7 @@ public class MigrateHandler extends AbstractHandler {
4243

4344
public static final String PAYARA_TRANSFORMER = "fish.payara.transformer";
4445
public static final String PAYARA_TRANSFORMER_MAVEN = "fish.payara.transformer.maven";
45-
public static final String PAYARA_TRANSFORMER_VERSION = "0.2.10";
46+
public static final String PAYARA_TRANSFORMER_VERSION = "0.2.15";
4647

4748
@Override
4849
public Object execute(ExecutionEvent event) throws ExecutionException {
@@ -97,23 +98,22 @@ private String chooseDestinationPath(String srcPath, String name, boolean isFile
9798
String selectedDirectory = dialog.open();
9899
if (selectedDirectory != null) {
99100
if (isFile) {
100-
String targetDir = selectedDirectory + "/jakartaee10-" + genRandomNumber() + "/";
101+
String targetDir = selectedDirectory + "/jakartaee10/";
101102
try {
102-
Files.createDirectories(Paths.get(targetDir));
103+
final Path path = Paths.get(targetDir);
104+
if (!Files.exists(path)) {
105+
Files.createDirectories(path);
106+
}
103107
return targetDir + name;
104108
} catch (IOException e) {
105109
throw new RuntimeException(e);
106110
}
107111
}
108-
return selectedDirectory + "/" + name + "-JakartaEE10-" + genRandomNumber();
112+
return selectedDirectory + "/" + name + "-JakartaEE10";
109113
}
110114
return "";
111115
}
112116

113-
private long genRandomNumber() {
114-
return Math.round(Math.random() * 1000000);
115-
}
116-
117117
private IStructuredSelection getSelection(ExecutionEvent event) {
118118
ISelection selection = HandlerUtil.getCurrentSelection(event);
119119
if (selection instanceof IStructuredSelection) {
@@ -133,7 +133,6 @@ private int runMvnCommand(String srcProjectPath, String srcPath, String targetPa
133133
try {
134134
List<String> command = new ArrayList<>();
135135
command.add(getMvnCommand());
136-
command.add("package");
137136
command.add(getTransformCommand());
138137
command.add("-DselectedSource=" + srcPath);
139138
command.add("-DselectedTarget=" + targetPath);

0 commit comments

Comments
 (0)