You need to change
private static final String BasePath ="C:\imgs"
to
private static final String BasePath ="C:\\imgs"
The single \ is an escape character and is causing an issue "Invalid escape character", this is because \i is expected to be an escape literal. (Which, luckily, it is not.) \\ Is the valid escape literal for a single \, and thus it solves the problem.
Continuing with the problem scenario, If you had, for example
String path = "c:\noproblem";
Then there is no issue compiling since \n is a valid escape character. (But it will cause other issues nonetheless.)
But what is even better, use the File.separator
From the Java Documentation
The default name-separator character is defined by the system property
file.separator, and is made available in the public static fields
separator and separatorChar of this class. When a pathname string is
converted into an abstract pathname, the names within it may be
separated by the default name-separator character or by any other
name-separator character that is supported by the underlying system.
Thus - it will change the use the seperator requiered by the Operating System.
Have a look at How to construct a file path in java