/** Find a good URL for this file object which works according to type: * <ul> * <li>inside this VM * <li>inside this machine * <li>from networked machines * </ul> * @return a suitable URL, or (only if not {@link #INTERNAL}) null */ public static URL findURL(FileObject fo, int type) { /** secondly registered URLMappers are asked to resolve URL */ for (URLMapper mapper : getInstances()) { URL retVal = mapper.getURL(fo, type); if (retVal != null) { return retVal; } } // if not resolved yet then internal URL with nbfs protocol is returned // XXX this would be better handled by making DefaultURLMapper just return nbfs for INTERNAL when necessary! if (type == INTERNAL) { return FileURL.encodeFileObject(fo); } return null; }
retVal = FileURL.encodeFileObject (fo); } catch (FileStateInvalidException iex) { return null;}
retVal = FileURL.encodeFileObject (fo); } catch (FileStateInvalidException iex) { return null;}