public static String getName ( final String aURLString ) { int pathnameEndIndex ; if ( isWindows ( ) ) { if ( aURLString . contains ( SHARP ) ) { pathnameEndIndex = aURLString . lastIndexOf ( SHARP ) ; } else { pathnameEndIndex = aURLString . lastIndexOf ( WINDOWS_SEPARATOR ) ; if ( pathnameEndIndex == - 1 ) { pathnameEndIndex = aURLString . lastIndexOf ( UNIX_SEPARATOR ) ; } } } else { if ( aURLString . contains ( SHARP ) ) { pathnameEndIndex = aURLString . lastIndexOf ( SHARP ) ; } pathnameEndIndex = aURLString . lastIndexOf ( UNIX_SEPARATOR ) ; } String schemaLocation ; if ( aURLString . contains ( SHARP ) ) { schemaLocation = aURLString . substring ( 0 , pathnameEndIndex ) ; } else { schemaLocation = aURLString . substring ( pathnameEndIndex + 1 ) ; } return schemaLocation ; }
Get filename from a path .