diff --git a/cobigen/cobigen-tsplugin/pom.xml b/cobigen/cobigen-tsplugin/pom.xml
index aaab698a16..39ee798c93 100644
--- a/cobigen/cobigen-tsplugin/pom.xml
+++ b/cobigen/cobigen-tsplugin/pom.xml
@@ -2,7 +2,7 @@
4.0.0
tsplugin
CobiGen - TypeScript Plug-in
- 7.0.0
+ 7.1.0
jar
CobiGen - TypeScript Plug-in
diff --git a/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/inputreader/TypeScriptInputReader.java b/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/inputreader/TypeScriptInputReader.java
index fb837b0db8..b15c6ff8a9 100644
--- a/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/inputreader/TypeScriptInputReader.java
+++ b/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/inputreader/TypeScriptInputReader.java
@@ -8,7 +8,9 @@
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
+import java.nio.file.Paths;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
@@ -16,6 +18,7 @@
import java.util.Map;
import java.util.stream.Stream;
+import org.apache.commons.io.FilenameUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -101,48 +104,26 @@ private Boolean startServerConnection() {
@Override
public boolean isValidInput(Object input) {
- String fileContents = null;
-
- Path path = null;
if (input instanceof Path) {
- path = (Path) input;
+ return true;
} else if (input instanceof File) {
- path = ((File) input).toPath();
+ return true;
} else {
- return false;
- }
-
- if (serverIsNotDeployed) {
- LOG.error("We have not been able to send requests to the external server. "
- + "Most probably there is an error on the executable file. "
- + "Try to manually remove folder .cobigen/externalservers found at your user root folder");
- return false;
- }
-
- // File content is not needed, as only the file extension is checked
- fileContents = new String("");
-
- String fileName = path.toString();
- InputFileTo inputFile = new InputFileTo(fileName, fileContents, charset);
-
- HttpURLConnection conn = request.getConnection("POST", "Content-Type", "application/json", "isValidInput");
-
- if (request.sendRequest(inputFile, conn, charset)) {
-
- String response = new String();
- try (InputStreamReader isr = new InputStreamReader(conn.getInputStream());
- BufferedReader br = new BufferedReader(isr);) {
-
- LOG.info("Receiving response from Server....");
- response = br.readLine();
-
- return Boolean.parseBoolean(response);
- } catch (IOException e) {
- connectionExc.handle(e);
+ try {
+ // Input corresponds to the parsed file
+ Map mapModel = createModel(input);
+ mapModel = (Map) mapModel.get("model");
+ if (Paths.get(mapModel.get("path").toString()) == null) {
+ return false;
+ }
+ return true;
+ } catch (Exception e) {
+ LOG.error("An exception occured while parsing the input", e);
+ return false;
}
}
- return false;
+
}
@Override
@@ -202,6 +183,7 @@ public List