Assignment3_Server_xmlrpc/src/service/FileService.java
public static Hashtable<String, byte[]> fillTestData(String sourceDir) {
		File dir = new File(sourceDir);
		File[] files = dir.listFiles();
		Hashtable<String, byte[]> ret = new Hashtable<String, byte[]>();
		for (File file : files) {
			try {
				ret.put(file.getName(), Files.readAllBytes(file.toPath()));	
			} catch (IOException e) {
				ret.put(file.getName(), e.getMessage().getBytes());
			}
			
		}
		
		return ret;
	}
// Fill pre-defined files & their data for testing purposes.
Fill pre-defined files & their data for testing purposes.
Fill pre - defined files & their data for testing purposes .
public static Hashtable<String, byte[]> fillTestData(String sourceDir) {
		File dir = new File(sourceDir);
		File[] files = dir.listFiles();
		Hashtable<String, byte[]> ret = new Hashtable<String, byte[]>();
		for (File file : files) {
			try {
				ret.put(file.getName(), Files.readAllBytes(file.toPath()));	
			} catch (IOException e) {
				ret.put(file.getName(), e.getMessage().getBytes());
			}
		}
		return ret;
	}
public static Hashtable < String , byte [ ] > fillTestData ( String sourceDir ) { File dir = new File ( sourceDir ) ; File [ ] files = dir . listFiles ( ) ; Hashtable < String , byte [ ] > ret = new Hashtable < String , byte [ ] > ( ) ; for ( File file : files ) { try { ret . put ( file . getName ( ) , Files . readAllBytes ( file . toPath ( ) ) ) ; } catch ( IOException e ) { ret . put ( file . getName ( ) , e . getMessage ( ) . getBytes ( ) ) ; } } return ret ; }
Fill pre-defined files & their data for testing purposes.
Fill pre - defined files & their data for testing purposes .