@Test public void testStoreInstanceResources_inexistingDirectory() throws Exception { Instance instance = new Instance( "whatever" ).component( new Component( "comp" )); Map<?,?> map = ResourceUtils.storeInstanceResources( new File( "file/does/not/exist" ), instance ); Assert.assertEquals( 0, map.size()); }
public static Map<String,byte[]> storeInstanceResources( File applicationFilesDirectory, Instance instance ) throws IOException { Map<String,byte[]> result = new HashMap<> (); File instanceResourcesDirectory = findInstanceResourcesDirectory( applicationFilesDirectory, instance ); if( instanceResourcesDirectory.exists() && instanceResourcesDirectory.isDirectory()) result.putAll( Utils.storeDirectoryResourcesAsBytes( instanceResourcesDirectory )); result.putAll( storeInstanceProbeResources( applicationFilesDirectory, instance )); return result; }
ResourceUtils { public static Map<String,byte[]> storeInstanceResources( File applicationFilesDirectory, Instance instance ) throws IOException { Map<String,byte[]> result = new HashMap<> (); File instanceResourcesDirectory = findInstanceResourcesDirectory( applicationFilesDirectory, instance ); if( instanceResourcesDirectory.exists() && instanceResourcesDirectory.isDirectory()) result.putAll( Utils.storeDirectoryResourcesAsBytes( instanceResourcesDirectory )); result.putAll( storeInstanceProbeResources( applicationFilesDirectory, instance )); return result; } }
ResourceUtils { public static Map<String,byte[]> storeInstanceResources( File applicationFilesDirectory, Instance instance ) throws IOException { Map<String,byte[]> result = new HashMap<> (); File instanceResourcesDirectory = findInstanceResourcesDirectory( applicationFilesDirectory, instance ); if( instanceResourcesDirectory.exists() && instanceResourcesDirectory.isDirectory()) result.putAll( Utils.storeDirectoryResourcesAsBytes( instanceResourcesDirectory )); result.putAll( storeInstanceProbeResources( applicationFilesDirectory, instance )); return result; } private  ResourceUtils(); }
ResourceUtils { public static Map<String,byte[]> storeInstanceResources( File applicationFilesDirectory, Instance instance ) throws IOException { Map<String,byte[]> result = new HashMap<> (); File instanceResourcesDirectory = findInstanceResourcesDirectory( applicationFilesDirectory, instance ); if( instanceResourcesDirectory.exists() && instanceResourcesDirectory.isDirectory()) result.putAll( Utils.storeDirectoryResourcesAsBytes( instanceResourcesDirectory )); result.putAll( storeInstanceProbeResources( applicationFilesDirectory, instance )); return result; } private  ResourceUtils(); static Map<String,byte[]> storeInstanceResources( File applicationFilesDirectory, Instance instance ); static Map<String,byte[]> storeInstanceProbeResources( File applicationFilesDirectory, Instance instance ); static File findInstanceResourcesDirectory( File applicationFilesDirectory, Instance instance ); static File findInstanceResourcesDirectory( File applicationFilesDirectory, Component component ); static Map<Component,File> findScopedInstancesDirectories( AbstractApplication absApp ); }
ResourceUtils { public static Map<String,byte[]> storeInstanceResources( File applicationFilesDirectory, Instance instance ) throws IOException { Map<String,byte[]> result = new HashMap<> (); File instanceResourcesDirectory = findInstanceResourcesDirectory( applicationFilesDirectory, instance ); if( instanceResourcesDirectory.exists() && instanceResourcesDirectory.isDirectory()) result.putAll( Utils.storeDirectoryResourcesAsBytes( instanceResourcesDirectory )); result.putAll( storeInstanceProbeResources( applicationFilesDirectory, instance )); return result; } private  ResourceUtils(); static Map<String,byte[]> storeInstanceResources( File applicationFilesDirectory, Instance instance ); static Map<String,byte[]> storeInstanceProbeResources( File applicationFilesDirectory, Instance instance ); static File findInstanceResourcesDirectory( File applicationFilesDirectory, Instance instance ); static File findInstanceResourcesDirectory( File applicationFilesDirectory, Component component ); static Map<Component,File> findScopedInstancesDirectories( AbstractApplication absApp );  }