FileSystemUtils { public static String getOpenDataCMSPrefix( String path ) throws IOException { if( path == null || path.isEmpty() ) { throw new IOException( "Empty path" ); } return path.substring( 0, 1 ); }  static synchronized String getCacheBase(); static Path getCacheDirectory(); static ScheduledFuture<?> scheduleAtFixedRate( Runnable command, long initialDelay, long period, TimeUnit unit ); static ScheduledFuture<?> schedule( Runnable command, long delay, TimeUnit unit ); static byte[] md5( String s ); static String getMediaWikiPrefix( String path ); static String getOpenDataCMSPrefix( String path ); static String getCachePrefix( String path ); static boolean isTrue( Map<String, ?> env, String name ); static boolean isFalse( Map<String, ?> env, String name ); static String getString( Map<String, ?> env, String key ); static String getString( Map<String, ?> env, String key, String defaultValue ); static String getString( Map<String, ?> env, String key, Supplier<String> defaultValue ); static long getLong( Map<String, ?> env, String key, long defaultValue ); static T get( Map<String, ?> env, String key ); static T get( Map<String, ?> env, String key, Supplier<T> defaultValue ); static final URI getCleanURI( URI uri ); static final URI getFileSystemURI( URI uri ); static final Map<String, ?> getFileSystemEnv( URI uri, Map<String, ?> env ); static long copy( InputStream source, OutputStream sink ); static E getEnum( Class<E> clazz, Map<String, ?> env, String key, E defaultValue ); static void copyFromRemote( IOSupplier<InputStream> src, FileSystemIO io, char[] path ); static final String CACHEBASE_PROPERTY; static final String CACHEBASE_ENV; static final String UTF8; }
@Test public void getOpenDataCMSPrefix() throws IOException { String p = FileSystemUtils.getOpenDataCMSPrefix( "Harry-Green-HampsteadHeath-copy.jpg" ); assertEquals( "H", p ); }