/** * Method that tries to create and return URL that denotes current * working directory. Usually used to create a context, when one is * not explicitly passed. */ public static URL urlFromCurrentDir() throws IOException /* MalformedURLException or such */ { /* This seems to work; independent of whether there happens to * be such/file dir or not. */ File parent = new File("a").getAbsoluteFile().getParentFile(); return toURL(parent); }
/** * Method that tries to create and return URL that denotes current * working directory. Usually used to create a context, when one is * not explicitly passed. */ public static URL urlFromCurrentDir() throws IOException /* MalformedURLException or such */ { /* This seems to work; independent of whether there happens to * be such/file dir or not. */ File parent = new File("a").getAbsoluteFile().getParentFile(); return toURL(parent); }
/** * Method that tries to create and return URL that denotes current * working directory. Usually used to create a context, when one is * not explicitly passed. */ public static URL urlFromCurrentDir() throws IOException /* MalformedURLException or such */ { /* This seems to work; independent of whether there happens to * be such/file dir or not. */ File parent = new File("a").getAbsoluteFile().getParentFile(); return toURL(parent); }
@SuppressWarnings("resource") @Override public XMLValidationSchema createSchema(File f) throws XMLStreamException { ReaderConfig rcfg = createPrivateReaderConfig(); try { URL url = URLUtil.toURL(f); return doCreateSchema(rcfg, StreamBootstrapper.getInstance (null, null, new FileInputStream(f)), null, url.toExternalForm(), url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
@SuppressWarnings("resource") @Override public XMLValidationSchema createSchema(File f) throws XMLStreamException { ReaderConfig rcfg = createPrivateReaderConfig(); try { URL url = URLUtil.toURL(f); return doCreateSchema(rcfg, StreamBootstrapper.getInstance (null, null, new FileInputStream(f)), null, url.toExternalForm(), url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
@SuppressWarnings("resource") @Override public XMLValidationSchema createSchema(File f) throws XMLStreamException { ReaderConfig rcfg = createPrivateReaderConfig(); try { URL url = URLUtil.toURL(f); return doCreateSchema(rcfg, StreamBootstrapper.getInstance (null, null, new FileInputStream(f)), null, url.toExternalForm(), url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
@SuppressWarnings("resource") protected XMLStreamReader2 createSR(File f, boolean forER, boolean autoCloseInput) throws XMLStreamException { ReaderConfig cfg = createPrivateConfig(); try { /* 18-Nov-2008, TSa: If P_BASE_URL is set, and File reference is * relative, let's resolve against base... */ if (!f.isAbsolute()) { URL base = cfg.getBaseURL(); if (base != null) { URL src = new URL(base, f.getPath()); return createSR(cfg, SystemId.construct(src), URLUtil.inputStreamFromURL(src), forER, autoCloseInput); } } final SystemId systemId = SystemId.construct(URLUtil.toURL(f)); return createSR(cfg, systemId, new FileInputStream(f), forER, autoCloseInput); } catch (IOException ie) { throw new WstxIOException(ie); } }
URL u = URLUtil.toURL((File) o); return sourceFromURL(parent, cfg, refName, xmlVersion, u, null);
@SuppressWarnings("resource") protected XMLStreamReader2 createSR(File f, boolean forER, boolean autoCloseInput) throws XMLStreamException { ReaderConfig cfg = createPrivateConfig(); try { /* 18-Nov-2008, TSa: If P_BASE_URL is set, and File reference is * relative, let's resolve against base... */ if (!f.isAbsolute()) { URL base = cfg.getBaseURL(); if (base != null) { URL src = new URL(base, f.getPath()); return createSR(cfg, SystemId.construct(src), URLUtil.inputStreamFromURL(src), forER, autoCloseInput); } } final SystemId systemId = SystemId.construct(URLUtil.toURL(f)); return createSR(cfg, systemId, new FileInputStream(f), forER, autoCloseInput); } catch (IOException ie) { throw new WstxIOException(ie); } }
@SuppressWarnings("resource") protected XMLStreamReader2 createSR(File f, boolean forER, boolean autoCloseInput) throws XMLStreamException { ReaderConfig cfg = createPrivateConfig(); try { /* 18-Nov-2008, TSa: If P_BASE_URL is set, and File reference is * relative, let's resolve against base... */ if (!f.isAbsolute()) { URL base = cfg.getBaseURL(); if (base != null) { URL src = new URL(base, f.getPath()); return createSR(cfg, SystemId.construct(src), URLUtil.inputStreamFromURL(src), forER, autoCloseInput); } } final SystemId systemId = SystemId.construct(URLUtil.toURL(f)); return createSR(cfg, systemId, new FileInputStream(f), forER, autoCloseInput); } catch (IOException ie) { throw new WstxIOException(ie); } }
URL u = URLUtil.toURL((File) o); return sourceFromURL(parent, cfg, refName, xmlVersion, u, null);
URL u = URLUtil.toURL((File) o); return sourceFromURL(parent, cfg, refName, xmlVersion, u, null);