|
@@ -276,23 +276,14 @@ public class AddObjectPopUp extends JDialog {
|
|
|
protected void copieFile() {
|
|
|
InputStream inStream = null;
|
|
|
OutputStream outStream = null;
|
|
|
- String jarLocation = "";
|
|
|
try {
|
|
|
File source = new File(filePath);
|
|
|
- // File dest = new File(System.getProperty("user.dir") +
|
|
|
- // "/bin/Images/", selectedFile.getName());
|
|
|
- // imagePath = "/Images/" + selectedFile.getName();
|
|
|
- try {
|
|
|
- jarLocation = getJarContainingFolder(this.getClass());
|
|
|
- } catch (Exception e) {
|
|
|
- // TODO Auto-generated catch block
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- File dest = new File(jarLocation + "/HolonGUI/Images/");
|
|
|
- dest.mkdirs();
|
|
|
-
|
|
|
- dest = new File(dest, selectedFile.getName());
|
|
|
- imagePath = jarLocation + "/HolonGUI/Images/" + selectedFile.getName();
|
|
|
+ File dest = new File(System.getProperty("user.home") + "/HolonGUI/Images/");
|
|
|
+
|
|
|
+ dest.mkdirs();
|
|
|
+ dest = new File(dest, selectedFile.getName());
|
|
|
+ imagePath = "" + dest;
|
|
|
+
|
|
|
inStream = new FileInputStream(source);
|
|
|
outStream = new FileOutputStream(dest);
|
|
|
byte[] buffer = new byte[1024];
|