/** Find an appropiate instance of FileObject that addresses this url * * @param url url to be converted to file object * @return file object corresponding to url or null if no one was found * @since 4.29 */ public static FileObject findFileObject(URL url) { if (url == null) { throw new NullPointerException("Cannot pass null URL to URLMapper.findFileObject"); // NOI18N } /** first basic implementation */ FileObject[] results = null; Iterator instances = getInstances().iterator(); while (instances.hasNext() && (results == null || results.length == 0)) { URLMapper mapper = (URLMapper) instances.next(); if (mapper == getDefault()) continue; results = mapper.getFileObjects(url); } /** first basic implementation */ if (results == null || results.length == 0) { results = getDefault().getFileObjects(url); } return (results != null && results.length > 0) ? results[0] : null; }
/** Find an appropiate instance of FileObject that addresses this url * * @param url url to be converted to file object * @return file object corresponding to url or null if no one was found * @since 4.29 */ public static FileObject findFileObject(URL url) { if (url == null) { throw new NullPointerException("Cannot pass null URL to URLMapper.findFileObject"); // NOI18N } /** first basic implementation */ FileObject[] results = null; Iterator instances = getInstances().iterator(); while (instances.hasNext() && (results == null || results.length == 0)) { URLMapper mapper = (URLMapper) instances.next(); if (mapper == getDefault()) continue; results = mapper.getFileObjects(url); } /** first basic implementation */ if (results == null || results.length == 0) { results = getDefault().getFileObjects(url); } return (results != null && results.length > 0) ? results[0] : null; }
while (instances.hasNext()) { URLMapper mapper = (URLMapper) instances.next(); if (mapper == getDefault ()) continue; retVal = mapper.getFileObjects(url); if (retVal != null) { retVal = getDefault ().getFileObjects (url); if (retVal != null) { retSet.addAll(Arrays.asList(retVal));
while (instances.hasNext()) { URLMapper mapper = (URLMapper) instances.next(); if (mapper == getDefault ()) continue; retVal = mapper.getFileObjects(url); if (retVal != null) { retVal = getDefault ().getFileObjects (url); if (retVal != null) { retSet.addAll(Arrays.asList(retVal));
while (instances.hasNext()) { URLMapper mapper = (URLMapper) instances.next(); if (mapper == getDefault ()) continue; retVal = mapper.getURL (fo, type); if (retVal != null) return retVal; retVal = getDefault ().getURL (fo, type); if (retVal != null) return retVal;
while (instances.hasNext()) { URLMapper mapper = (URLMapper) instances.next(); if (mapper == getDefault ()) continue; retVal = mapper.getURL (fo, type); if (retVal != null) return retVal; retVal = getDefault ().getURL (fo, type); if (retVal != null) return retVal;