1 29 30 package com.caucho.vfs; 31 32 import java.lang.reflect.Method ; 33 34 37 public class JniFilePath { 38 public static FilesystemPath create() 39 { 40 try { 41 Class pathClass = Class.forName("com.caucho.vfs.JniFilePathImpl"); 42 43 Method isEnabled = pathClass.getMethod("isEnabled", new Class [0]); 44 45 Object result = isEnabled.invoke(null); 46 47 if (Boolean.TRUE.equals(result)) 48 return (FilesystemPath) pathClass.newInstance(); 49 } catch (ClassNotFoundException e) { 50 } catch (Throwable e) { 51 e.printStackTrace(); 52 } 53 54 return null; 55 } 56 } 57 | Popular Tags |