String currentClassPath = RandomCheckCode.class.getResource(File.separator).toString();
int beginIndex = currentClassPath.indexOf("/", 0)+1;
int endIndex = currentClassPath.lastIndexOf("/")+1;
String OS = System.getProperty("os.name").toLowerCase();
if(OS.indexOf("win")!=-1)
beginIndex+=1;
System.out.println("path: "+ currentClassPath.substring(beginIndex, endIndex));
int beginIndex = currentClassPath.indexOf("/", 0)+1;
int endIndex = currentClassPath.lastIndexOf("/")+1;
String OS = System.getProperty("os.name").toLowerCase();
if(OS.indexOf("win")!=-1)
beginIndex+=1;
System.out.println("path: "+ currentClassPath.substring(beginIndex, endIndex));