Skip to content

Commit

Permalink
File type fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jyrkioraskari committed Jun 7, 2022
1 parent 15fc82a commit fa417fd
Show file tree
Hide file tree
Showing 25 changed files with 219 additions and 100 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# mvdXML Checker
version 2.54.0
version 2.54.1

Jyrki Oraskari

Expand Down
2 changes: 1 addition & 1 deletion mvdXMLChecker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
<version>${mvdxml_check_project.version}</version>

<properties>
<mvdxml_check_project.version>2.54.0</mvdxml_check_project.version>
<mvdxml_check_project.version>2.54.1</mvdxml_check_project.version>
</properties>
</project>
6 changes: 6 additions & 0 deletions mvdXMLCheckerCommon/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,11 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">

<wb-module deploy-name="mvdXMLCheckerCore">

<wb-resource deploy-path="/" source-path="/src/main/resources"/>

<wb-resource deploy-path="/" source-path="/src/main/java"/>

</wb-module>

</project-modules>
2 changes: 1 addition & 1 deletion mvdXMLCheckerCommon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<version>${mvdxml_check_project.version}</version>

<properties>
<mvdxml_check_project.version>2.54.0</mvdxml_check_project.version>
<mvdxml_check_project.version>2.54.1</mvdxml_check_project.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
Expand Down
11 changes: 11 additions & 0 deletions mvdXMLCheckerCore1dot1/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,16 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">

<wb-module deploy-name="mvdXMLCheckerCore">

<wb-resource deploy-path="/" source-path="/src/main/resources"/>

<wb-resource deploy-path="/" source-path="/src/main/java"/>

</wb-module>

</project-modules>
2 changes: 1 addition & 1 deletion mvdXMLCheckerCore1dot1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<version>${mvdxml_check_project.version}</version>

<properties>
<mvdxml_check_project.version>2.54.0</mvdxml_check_project.version>
<mvdxml_check_project.version>2.54.1</mvdxml_check_project.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
Expand Down
11 changes: 11 additions & 0 deletions mvdXMLCheckerCore1dot2/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,16 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">

<wb-module deploy-name="mvdXMLCheckerCore">

<wb-resource deploy-path="/" source-path="/src/main/resources"/>

<wb-resource deploy-path="/" source-path="/src/main/java"/>

</wb-module>

</project-modules>
2 changes: 1 addition & 1 deletion mvdXMLCheckerCore1dot2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<version>${mvdxml_check_project.version}</version>

<properties>
<mvdxml_check_project.version>2.54.0</mvdxml_check_project.version>
<mvdxml_check_project.version>2.54.1</mvdxml_check_project.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
Expand Down
11 changes: 11 additions & 0 deletions mvdXMLCheckerCore1underscore1/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,16 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">

<wb-module deploy-name="mvdXMLCheckerCore1underscore1">

<wb-resource deploy-path="/" source-path="/src/main/resources"/>

<wb-resource deploy-path="/" source-path="/src/main/java"/>

</wb-module>

</project-modules>
2 changes: 1 addition & 1 deletion mvdXMLCheckerCore1underscore1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<version>${mvdxml_check_project.version}</version>

<properties>
<mvdxml_check_project.version>2.54.0</mvdxml_check_project.version>
<mvdxml_check_project.version>2.54.1</mvdxml_check_project.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
Expand Down
32 changes: 20 additions & 12 deletions mvdXMLCheckerOpenAPI/.settings/org.eclipse.wst.common.component
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">






Expand All @@ -9,7 +10,8 @@


<wb-module deploy-name="mvdXMLChecker">






Expand All @@ -19,7 +21,8 @@


<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>






Expand All @@ -29,7 +32,8 @@


<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>






Expand All @@ -39,19 +43,20 @@


<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<dependent-module archiveName="mvdXMLCheckerCore1dot1-2.54.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/mvdXMLCheckerCore1dot1/mvdXMLCheckerCore1dot1">
<dependent-module archiveName="mvdXMLCheckerCore1dot1-2.54.1.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/mvdXMLCheckerCore1dot1/mvdXMLCheckerCore1dot1">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="mvdXMLCheckerCommon-2.54.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/mvdXMLCheckerCommon/mvdXMLCheckerCommon">
<dependent-module archiveName="mvdXMLCheckerCommon-2.54.1.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/mvdXMLCheckerCommon/mvdXMLCheckerCommon">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="mvdXMLCheckerCore1dot2-2.54.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/mvdXMLCheckerCore1dot2/mvdXMLCheckerCore1dot2">
<dependent-module archiveName="mvdXMLCheckerCore1dot2-2.54.1.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/mvdXMLCheckerCore1dot2/mvdXMLCheckerCore1dot2">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="mvdXMLCheckerCore1underscore1-2.54.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/mvdXMLCheckerCore1underscore1/mvdXMLCheckerCore1underscore1">
<dependent-module archiveName="mvdXMLCheckerCore1underscore1-2.54.1.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/mvdXMLCheckerCore1underscore1/mvdXMLCheckerCore1underscore1">
<dependency-type>uses</dependency-type>
</dependent-module>






Expand All @@ -61,7 +66,8 @@


<property name="java-output-path" value="/mvdXMLCheckerOpenAPI/build/classes"/>






Expand All @@ -71,7 +77,8 @@


<property name="context-root" value="mvdXMLChecker"/>






Expand All @@ -81,7 +88,8 @@


</wb-module>






Expand Down
2 changes: 1 addition & 1 deletion mvdXMLCheckerOpenAPI/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<name>mvdXMLChecker OpenAPI Interface</name>

<properties>
<mvdxml_check_project.version>2.54.0</mvdxml_check_project.version>
<mvdxml_check_project.version>2.54.1</mvdxml_check_project.version>
<jersey2.version>2.30</jersey2.version>
<jaxrs.version>2.1.1</jaxrs.version>
<tomcat.version>7.0.69</tomcat.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package de.rwth_aachen.dc.mvd.ifcvalidator.rest;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
Expand All @@ -11,10 +12,9 @@
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.StreamingOutput;
import javax.ws.rs.core.Response.ResponseBuilder;
import javax.xml.bind.JAXBException;

import org.apache.commons.io.IOUtils;
Expand All @@ -29,7 +29,6 @@
import de.rwth_aachen.dc.mvd.mvdxml1dot2.checker.MvdXMLv1dot2Check;
import de.rwth_aachen.dc.mvd.mvdxml1underscore1.checker.MvdXMLv1undescore1Check;


@Path("/")
public class IfcValidatorAPI {

Expand All @@ -42,7 +41,6 @@ public class IfcValidatorAPI {
}
}


/**
* Checks the validity the validity of the given IFC Step file content against
* the referred mvdXML. Provides a JSON result.
Expand Down Expand Up @@ -88,8 +86,7 @@ private void execute_check(MvdXMLCheckerResultsReportBean issueReportBean, File
// mvdXML 1.1
issueReportBean.setMessage("a valid mvdXML 1.1 file");
IssueReport issueReport = MvdXMLv1dot1Check.check(tempIfcFile.toPath(), tempMvdxmlFile.getAbsolutePath());
if (issueReport != null)
{
if (issueReport != null) {
issueReportBean.getIssues().addAll(issueReport.getIssues());
issueReportBean.getElement_check_results().addAll(issueReport.getElementCheckResults());
issueReportBean.getGeneral_comments().addAll(issueReport.getGeneral_comments());
Expand All @@ -100,8 +97,7 @@ private void execute_check(MvdXMLCheckerResultsReportBean issueReportBean, File
if (MvdXMLVersionCheck.checkMvdXMLSchemaVersion(tempMvdxmlFile.getAbsolutePath(), "http://buildingsmart-tech.org/mvd/XML/1.2")) {
issueReportBean.setMessage("a mvdXML 1.2 file");
IssueReport issueReport = MvdXMLv1dot2Check.check(tempIfcFile.toPath(), tempMvdxmlFile.getAbsolutePath());
if (issueReport != null)
{
if (issueReport != null) {
issueReportBean.getIssues().addAll(issueReport.getIssues());
issueReportBean.getElement_check_results().addAll(issueReport.getElementCheckResults());
issueReportBean.getGeneral_comments().addAll(issueReport.getGeneral_comments());
Expand All @@ -111,12 +107,11 @@ private void execute_check(MvdXMLCheckerResultsReportBean issueReportBean, File
if (MvdXMLVersionCheck.checkMvdXMLSchemaVersion(tempMvdxmlFile.getAbsolutePath(), "http://buildingsmart-tech.org/mvdXML/mvdXML1-1")) {
issueReportBean.setMessage("a mvdXML 1_1 file");
IssueReport issueReport = MvdXMLv1undescore1Check.check(tempIfcFile.toPath(), tempMvdxmlFile.getAbsolutePath());
if (issueReport != null)
{
issueReportBean.getIssues().addAll(issueReport.getIssues());
issueReportBean.getElement_check_results().addAll(issueReport.getElementCheckResults());
issueReportBean.getGeneral_comments().addAll(issueReport.getGeneral_comments());
}
if (issueReport != null) {
issueReportBean.getIssues().addAll(issueReport.getIssues());
issueReportBean.getElement_check_results().addAll(issueReport.getElementCheckResults());
issueReportBean.getGeneral_comments().addAll(issueReport.getGeneral_comments());
}
} else
issueReportBean.setMessage("Error: Unknown mvdXML version");
}
Expand Down Expand Up @@ -160,19 +155,19 @@ public Response check(@FormDataParam("mvdXMLfile") InputStream mvdXMLfile, @Form
}

final File final_BCFZipFile = tempBCFZipFile;
StreamingOutput fileStream = new StreamingOutput() {
@Override
public void write(java.io.OutputStream output) throws IOException, WebApplicationException {
try {
byte[] data = Files.readAllBytes(final_BCFZipFile.toPath());
output.write(data);
output.flush();
} catch (Exception e) {
throw new WebApplicationException("File Not Found !!");
}
}
};
return Response.ok(fileStream, MediaType.APPLICATION_OCTET_STREAM).header("content-disposition", "attachment; filename = result.bcfzip").build();
/*
* StreamingOutput fileStream = new StreamingOutput() {
*
* @Override public void write(java.io.OutputStream output) throws IOException,
* WebApplicationException { try { byte[] data =
* Files.readAllBytes(final_BCFZipFile.toPath()); output.write(data);
* output.flush(); } catch (Exception e) { throw new
* WebApplicationException("File Not Found !!"); } } };
*/

ResponseBuilder response = Response.ok((Object) final_BCFZipFile);
response.header("Content-Disposition", "attachment; filename=\"result.bcfzip\"");
return response.build();
} catch (Exception e) {
e.printStackTrace();
issueReportBean.setCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
Expand Down Expand Up @@ -214,5 +209,4 @@ private File execute_check(File tempBCFZipFile, File tempIfcFile, File tempMvdxm
return tempBCFZipFile;
}


}
11 changes: 11 additions & 0 deletions mvdXMLCommandLineChecker/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,16 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Loading

0 comments on commit fa417fd

Please sign in to comment.