comparison src/ch/ethz/ssh2/compression/CompressionFactory.java @ 327:9a657362519c ganymed

pickup compression from trilead
author Carl Byington <carl@five-ten-sg.com>
date Thu, 31 Jul 2014 11:18:21 -0700
parents 97da8c5fb40a
children 459eb9b6b84e
comparison
equal deleted inserted replaced
326:97da8c5fb40a 327:9a657362519c
57 public static void checkCompressorList(String[] compressorCandidates) { 57 public static void checkCompressorList(String[] compressorCandidates) {
58 for (int i = 0; i < compressorCandidates.length; i++) 58 for (int i = 0; i < compressorCandidates.length; i++)
59 getEntry(compressorCandidates[i]); 59 getEntry(compressorCandidates[i]);
60 } 60 }
61 61
62 public static ICompressor createCompressor(String type) { 62 public static Compressor createCompressor(String type) {
63 try { 63 try {
64 CompressorEntry ce = getEntry(type); 64 CompressorEntry ce = getEntry(type);
65 65
66 if ("".equals(ce.compressorClass)) 66 if ("".equals(ce.compressorClass))
67 return null; 67 return null;
68 68
69 Class<?> cc = Class.forName(ce.compressorClass); 69 Class<?> cc = Class.forName(ce.compressorClass);
70 ICompressor cmp = (ICompressor) cc.newInstance(); 70 Compressor cmp = (Compressor) cc.newInstance();
71 return cmp; 71 return cmp;
72 } 72 }
73 catch (Exception e) { 73 catch (Exception e) {
74 throw new IllegalArgumentException("Cannot instantiate " + type); 74 throw new IllegalArgumentException("Cannot instantiate " + type);
75 } 75 }