Ok it turns out I was doing something stupid. I hadn’t appended the new file name to the path.
I had
rootDirectory = "C:\\safesite_documents"
but it should have been
rootDirectory = "C:\\safesite_documents\\newFile.jpg"
Sorry it was a stupid mistake as always.
Related Posts:
- What exactly is Apache Camel?
- How does the Java ‘for each’ loop work?
- How does the Java ‘for each’ loop work?
- What does “Could not find or load main class” mean?
- What is the proper way to handle a NumberFormatException when it is expected?
- How to convert/parse from String to char in java?
- Is there a Heap in java?
- Error parsing data org.json.JSONException: Value
- What is the difference between a static method and a non-static method?
- What is Java Servlet?
- Non-static variable cannot be referenced from a static context
- Round a double to 2 decimal places [duplicate]
- EOFException – how to handle?
- A long bigger than Long.MAX_VALUE
- How to fix array index out of bounds error?
- Initialize List
- > in Java
- How do I limit the number of decimals printed for a double?
- “No X11 DISPLAY variable” – what does it mean?
- java.io.FileNotFoundException: the system cannot find the file specified
- Java integer list
- I want to declare an empty array in java and then I want do update it but the code is not working
- The @ symbol in java
- Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 0 error in Java
- Explain the use of a bit vector for determining if all characters are unique
- Extracting .jar file with command line
- Declaring an unsigned int in Java
- Check jdk/JRE is installed and get path for jvm.dll
- What is a Question Mark “?” and Colon “:” Operator Used for?
- How to remove single character from a String
- How do I set environment variables from Java?
- Why am I still getting a cannot find Java SE Runtime Environment?
- What is the significance of log4j.rootLogger property in log4j.properties file? What happens if I don’t use this property?
- implicit super constructor Person() is undefined. Must explicitly invoke another constructor?
- How to resolve Error listenerStart when deploying web-app in Tomcat 5.5?
- What is the difference between a local variable, an instance field, an input parameter, and a class field?
- Shifting array to the right – homework
- JRE 1.7 – java version – returns: java/lang/NoClassDefFoundError: java/lang/Object
- Integrate Ant builder into Eclipse: Error “Variable references empty selection”
- Very Basic Java
- Spring Maven clean error – The requested profile “pom.xml” could not be activated because it does not exist
- what is Ljava.lang.String;@
- Double cannot be dereferenced?
- paint() and repaint() in Java
- Good Hash Function for Strings
- What is the difference between object-oriented languages and non object-oriented languages?
- Orphaned Case Error in Java
- java.lang.ClassNotFoundException: org.sqlite.JDBC error in Sample.java program from xerial
- Installing jdk8 on ubuntu- “unable to locate package” update doesn’t fix
- how to do a system pause in java for debugging?
- Is spring default scope singleton or not?
- IDEA: javac: source release 1.7 requires target release 1.7
- Java Reflection – Object is not an instance of declaring class
- Can we write our own iterator in Java?
- IntelliJ – Can’t start – “JAVA_HOME does not point to a valid JVM installation”
- Syntax error on token(s), misplaced construct(s)
- Class is not Abstract and does not Override error in Java
- JAVA Variable declaration not allowed here
- Comparing strings by their alphabetical order
- exposed beyond app through ClipData.Item.getUri
- Corrupt jar file
- Java word count program
- How to write an ArrayList of Strings into a text file?
- MultipartException: Current request is not a multipart request
- difference between equals() and hashCode()
- The C# Shorthand getters and setters
- try catch ArrayIndexOutOfBoundsException?
- how to make jni.h be found?
- Cannot resolve symbol ‘button’ -Android Studio
- Recompile with -Xlint:deprecation for details
- Syntax error on token “;”, { expected after this token in Random string creator
- Two dimensional array list
- Java: How To Call Non Static Method From Main Method?
- What does idempotent method mean and what are the side effects in case of calling close method of java.lang.AutoCloseable?
- How to “wait” a Thread in Android
- How to use regex in String.contains() method in Java
- Error: Module not specified (IntelliJ IDEA)
- Why is there no multiple inheritance in Java, but implementing multiple interfaces is allowed?
- What’s the difference between JPA and Hibernate?
- Throwing multiple exceptions in Java
- fixing errors on a program to call methods in java
- How can I calculate a time difference in Java?
- Any shortcut to initialize all array elements to zero?
- Creating a Calendar using javafx
- Align printf output in Java
- How to print binary tree diagram in Java?
- Must qualify the allocation with an enclosing instance of type GeoLocation
- How to get rows and columns count of a 2D array in Java?
- What is the difference between local and instance variables in Java?
- Difference between volatile and synchronized in Java
- intellij idea – Error: java: invalid source release 1.9
- How fix Error:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
- Is it okay to throw NullPointerException programmatically?
- Read next word in java
- Exception in thread “AWT-EventQueue-0” java.lang.OutOfMemoryError: Java heap space
- How to enable the Java keyword assert in Eclipse program-wise?
- return an ArrayList method
- Could not find or load main class with a Jar File
- How can I catch all the exceptions that will be thrown through reading and writing a file?
- How to convert java.util.Date to java.sql.Date?
- How can I design a class named allergy?