Skip to content
Snippets Groups Projects
Commit f30c9aa6 authored by pr1n19's avatar pr1n19
Browse files

Added file separators between filepath and filename

parent 2bf9e310
Branches
No related tags found
No related merge requests found
...@@ -86,7 +86,7 @@ public class DStore { ...@@ -86,7 +86,7 @@ public class DStore {
fileList.add(fileName); fileList.add(fileName);
} }
case "LOAD_DATA" -> //Load file in new thread case "LOAD_DATA" -> //Load file in new thread
new Thread(new LoadThread((fileFolder+fileName),in,out,client)).start(); new Thread(new LoadThread((fileFolder+File.separator+fileName),in,out,client)).start();
} }
}catch (Exception e){ }catch (Exception e){
System.out.println("error "+e); System.out.println("error "+e);
...@@ -111,7 +111,7 @@ public class DStore { ...@@ -111,7 +111,7 @@ public class DStore {
private static void removeFile(String filePath, String fileName){ private static void removeFile(String filePath, String fileName){
//Remove file from folder //Remove file from folder
File file = new File(filePath+fileName); File file = new File(filePath+File.separator+fileName);
file.delete(); file.delete();
//Remove file from list //Remove file from list
......
...@@ -28,7 +28,7 @@ public class StoreThread implements Runnable{ ...@@ -28,7 +28,7 @@ public class StoreThread implements Runnable{
out.write("ACK".getBytes()); out.write("ACK".getBytes());
//Prepare to write to file //Prepare to write to file
File outputFile = new File(filePath+fileName); File outputFile = new File(filePath+File.separator+fileName);
FileOutputStream fileOutput = new FileOutputStream(outputFile); FileOutputStream fileOutput = new FileOutputStream(outputFile);
//Read correct bytes from input stream and write to file //Read correct bytes from input stream and write to file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment