Skip to content

Commit

Permalink
Corrected checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Matus Kasak committed Nov 22, 2024
1 parent dc43d33 commit 65b2c54
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
17 changes: 12 additions & 5 deletions dspace-api/src/main/java/org/dspace/testing/Testing.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@
*/
package org.dspace.testing;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;

import org.apache.commons.cli.ParseException;
import org.dspace.scripts.DSpaceRunnable;
import org.dspace.utils.DSpace;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class Testing extends DSpaceRunnable<TestingScriptConfiguration> {

@Override
Expand All @@ -32,7 +37,8 @@ public void internalRun() throws Exception {
System.out.println("Hello world from java");
try {
// loading python scripts stored in resources
InputStream scriptInputStream = getClass().getClassLoader().getResourceAsStream("python-script.py");
InputStream scriptInputStream =
getClass().getClassLoader().getResourceAsStream("testing/python-script.py");
if (scriptInputStream == null) {
throw new FileNotFoundException("Python script not found in resources");
}
Expand All @@ -49,7 +55,8 @@ public void internalRun() throws Exception {
processBuilder.directory(tempFile.getParentFile());
Process process = processBuilder.start();

InputStreamReader inputStreamReader = new InputStreamReader(process.getInputStream(), StandardCharsets.UTF_8);
InputStreamReader inputStreamReader =
new InputStreamReader(process.getInputStream(), StandardCharsets.UTF_8);
BufferedReader reader = new BufferedReader(inputStreamReader);

// reading the scripts output and then outputs it to the console
Expand Down
8 changes: 0 additions & 8 deletions dspace-api/src/main/resources/python-script.py

This file was deleted.

8 changes: 8 additions & 0 deletions dspace-api/src/main/resources/testing/python-script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# The contents of this file are subject to the license and copyright
# detailed in the LICENSE and NOTICE files at the root of the source
# tree and available online at
#
# http://www.dspace.org/license/
#
print("Hello world from python")

0 comments on commit 65b2c54

Please sign in to comment.