@Test public void testAsSystemSpecificPath() { String urlPath = "c:\\workdir\\server-local\\instance\\tmp\\vfs\\deployment\\deploymentf7b5abe7c4c1cb56\\rules-with-kjar-1.0.jar-57cc270a5729d6b2\\rules-with-kjar-1.0.jar"; String specificPath = IoUtils.asSystemSpecificPath(urlPath, 1); assertEquals(urlPath, specificPath); }
public static String asSystemSpecificPath(String urlPath, int colonIndex) { String ic = urlPath.substring( Math.max( 0, colonIndex - 2 ), colonIndex + 1 ); if ( ic.matches( "\\/[a-zA-Z]:" ) ) { return urlPath.substring( colonIndex - 2 ); } else if ( ic.matches( "[a-zA-Z]:" ) ) { return urlPath.substring( colonIndex - 1 ); } else { return urlPath.substring( colonIndex + 1 ); } }
IoUtils { public static String asSystemSpecificPath(String urlPath, int colonIndex) { String ic = urlPath.substring( Math.max( 0, colonIndex - 2 ), colonIndex + 1 ); if ( ic.matches( "\\/[a-zA-Z]:" ) ) { return urlPath.substring( colonIndex - 2 ); } else if ( ic.matches( "[a-zA-Z]:" ) ) { return urlPath.substring( colonIndex - 1 ); } else { return urlPath.substring( colonIndex + 1 ); } } }
IoUtils { public static String asSystemSpecificPath(String urlPath, int colonIndex) { String ic = urlPath.substring( Math.max( 0, colonIndex - 2 ), colonIndex + 1 ); if ( ic.matches( "\\/[a-zA-Z]:" ) ) { return urlPath.substring( colonIndex - 2 ); } else if ( ic.matches( "[a-zA-Z]:" ) ) { return urlPath.substring( colonIndex - 1 ); } else { return urlPath.substring( colonIndex + 1 ); } }  }
IoUtils { public static String asSystemSpecificPath(String urlPath, int colonIndex) { String ic = urlPath.substring( Math.max( 0, colonIndex - 2 ), colonIndex + 1 ); if ( ic.matches( "\\/[a-zA-Z]:" ) ) { return urlPath.substring( colonIndex - 2 ); } else if ( ic.matches( "[a-zA-Z]:" ) ) { return urlPath.substring( colonIndex - 1 ); } else { return urlPath.substring( colonIndex + 1 ); } }  static int findPort(); static boolean validPort(int port); static String readFileAsString(File file); static void copyFile(File sourceFile, File destFile); static long copy( InputStream input, OutputStream output ); static File copyInTempFile( InputStream input, String fileExtension ); static List<String> recursiveListFile(File folder); static List<String> recursiveListFile(File folder, String prefix, Predicate<File> filter); static byte[] readBytesFromInputStream(InputStream input); static byte[] readBytesFromInputStream(InputStream input, boolean closeInput); static byte[] readBytesFromZipEntry(File file, ZipEntry entry); static byte[] readBytes(File f); static void write(File f,
                             byte[] data); static void writeBytes(File f, byte[] data); static boolean areByteArraysEqual(byte[] b1,
                                             byte[] b2); static String asSystemSpecificPath(String urlPath, int colonIndex); }
IoUtils { public static String asSystemSpecificPath(String urlPath, int colonIndex) { String ic = urlPath.substring( Math.max( 0, colonIndex - 2 ), colonIndex + 1 ); if ( ic.matches( "\\/[a-zA-Z]:" ) ) { return urlPath.substring( colonIndex - 2 ); } else if ( ic.matches( "[a-zA-Z]:" ) ) { return urlPath.substring( colonIndex - 1 ); } else { return urlPath.substring( colonIndex + 1 ); } }  static int findPort(); static boolean validPort(int port); static String readFileAsString(File file); static void copyFile(File sourceFile, File destFile); static long copy( InputStream input, OutputStream output ); static File copyInTempFile( InputStream input, String fileExtension ); static List<String> recursiveListFile(File folder); static List<String> recursiveListFile(File folder, String prefix, Predicate<File> filter); static byte[] readBytesFromInputStream(InputStream input); static byte[] readBytesFromInputStream(InputStream input, boolean closeInput); static byte[] readBytesFromZipEntry(File file, ZipEntry entry); static byte[] readBytes(File f); static void write(File f,
                             byte[] data); static void writeBytes(File f, byte[] data); static boolean areByteArraysEqual(byte[] b1,
                                             byte[] b2); static String asSystemSpecificPath(String urlPath, int colonIndex); static final Charset UTF8_CHARSET; }