/** Add a file locator which uses dir as its working directory */ public void addLocatorFile(String dir) { LocatorFile fLoc = new LocatorFile(dir) ; addLocator(fLoc) ; }
@Override public boolean equals( Object other ) { return other instanceof LocatorFile && equals( thisDir, ((LocatorFile) other).thisDir ); }
public boolean exists(String filenameOrURI) { File f = toFile(filenameOrURI) ; if ( f == null ) return false ; return f.exists() ; }
private void testLocatorFileHashCode( String dirName ) { assertEquals( dirName.hashCode(), new LocatorFile( dirName ).hashCode() ); }
public static Locator convert(org.apache.jena.util.Locator oldloc) { if ( oldloc instanceof org.apache.jena.util.LocatorFile ) { org.apache.jena.util.LocatorFile lFile = (org.apache.jena.util.LocatorFile)oldloc; return new LocatorFile(lFile.getDir()); } if ( oldloc instanceof org.apache.jena.util.LocatorClassLoader ) { org.apache.jena.util.LocatorClassLoader classLoc = (org.apache.jena.util.LocatorClassLoader)oldloc; return new LocatorClassLoader(classLoc.getClassLoader()); } if ( oldloc instanceof org.apache.jena.util.LocatorURL ) return new LocatorHTTP(); if ( oldloc instanceof org.apache.jena.util.LocatorZip ) { org.apache.jena.util.LocatorZip zipLoc = (org.apache.jena.util.LocatorZip)oldloc; return new LocatorZip(zipLoc.getZipFileName()); } throw new RiotException("Unrecognized Locator: " + Lib.className(oldloc)); } }
private void testLocatorFileHashCode( String dirName ) { assertEquals( dirName.hashCode(), new LocatorFile( dirName ).hashCode() ); }
/** Add a file locator which uses dir as its working directory */ public void addLocatorFile(String dir) { LocatorFile fLoc = new LocatorFile(dir) ; addLocator(fLoc) ; }
public boolean exists(String filenameOrURI) { File f = toFile(filenameOrURI) ; if ( f == null ) return false ; return f.exists() ; }
@Override public boolean equals( Object other ) { return other instanceof LocatorFile && equals( thisDir, ((LocatorFile) other).thisDir ); }
public void testLocatorFileEquality() { Locator A1 = new LocatorFile( "foo/bar" ); Locator A2 = new LocatorFile( "foo/bar" ); Locator B = new LocatorFile( "bill/ben" ); testLocatorEquality( A1, A2, B ); }
File f = toFile(filenameOrURI) ;
public void testLocatorFileEquality() { Locator A1 = new LocatorFile( "foo/bar" ); Locator A2 = new LocatorFile( "foo/bar" ); Locator B = new LocatorFile( "bill/ben" ); testLocatorEquality( A1, A2, B ); }
File f = toFile(filenameOrURI) ;
private void doTests() { _results.clear(); try { final String base = new URI(_manifest).getPath(); FileManager.get().addLocator(new LocatorFile(base)); } catch (final URISyntaxException e) { e.printStackTrace(); } _doTest(_manifest); printStatistics(); }
public JenaWebOntTester() { _mapper = new LocationMapper(); final FileManager manager = OntDocumentManager.getInstance().getFileManager(); manager.setLocationMapper(_mapper); manager.addLocator(new LocatorFile(null)); }