o = m.getAttribute(attrName); } catch (Exception e) { ExternalUtil.annotate(e, "fileName = " + fileName); //NOI18N ExternalUtil.exception(e); return (mo == null) ? null : mo.get(); } catch (IOException e) { ExternalUtil.log("Cannot load attribute " + attrName + " from " + fileName); // NOI18N ExternalUtil.exception(e); } catch (ClassNotFoundException e) { ExternalUtil.log("Cannot load attribute " + attrName + " from " + fileName); // NOI18N ExternalUtil.exception(e);
/** Constructor. Creates new XMLFileSystem. * @param uri to file with definition of XMLFileSystem * @throws SAXException if parsing is not succesful */ public XMLFileSystem(String uri) throws SAXException { this(); if (uri == null) { throw new NullPointerException("Null uri"); // NOI18N } try { setXmlUrl(new URL(uri)); } catch (Exception e) { throw (SAXException) ExternalUtil.copyAnnotation(new SAXException(e.getMessage()), e); } }
NbBundle.getMessage(DefaultAttributes.class, "EXC_DefAttrReadErr") + ": " + folderName ); ExternalUtil.copyAnnotation(summaryEx, e); ExternalUtil.exception(summaryEx);
/** * added for future use - convert NbMarshalledObject to primitive data types and other supported types (if possible) */ static Object unMarshallObjectRecursively(Object mo) { Object o = mo; while (o instanceof NbMarshalledObject) { try { o = ((NbMarshalledObject) o).get(); } catch (IOException e) { ExternalUtil.exception(e); return mo; } catch (ClassNotFoundException e) { ExternalUtil.exception(e); return mo; } } return (o == null) ? mo : o; }
protected InputStream inputStream(String name) throws java.io.FileNotFoundException { InputStream fis; File file = null; try { fis = new BufferedInputStream(new FileInputStream(file = getFile(name))); } catch (FileNotFoundException exc) { if ((file == null) || !file.exists()) { ExternalUtil.annotate(exc, NbBundle.getMessage(LocalFileSystem.class, "EXC_FileOutsideModified", getFile(name))); } throw exc; } return fis; }
/** Access method to get default instance of repository in the system. * The instance is either taken as a result of * <CODE>org.openide.util.Lookup.getDefault ().lookup (Repository.class)</CODE> * or (if the lookup query returns null) a default instance is created. * * @return default repository for the system */ public static Repository getDefault () { return ExternalUtil.getRepository (); }
/** Initializes the root of FS. */ private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { ois.defaultReadObject(); closeSync = new Object(); strongCache = null; softCache = new SoftReference<Cache>(null); aliveCount = 0; try { setJarFile(root); } catch (PropertyVetoException ex) { throw new IOException(ex.getMessage()); } catch (IOException iex) { ExternalUtil.log(iex.getLocalizedMessage()); } }
/** Initializes the context and errManager */ private static void initialize () { if (!isInitialized ()) { Lookup l = Lookup.getDefault (); Repository rep = (Repository)l.lookup (org.openide.filesystems.Repository.class); setRepository (rep); } }
if (sepIdx != -1) { String methodName = value.substring(sepIdx + 1); Class cls = ExternalUtil.findClass(value.substring(0, sepIdx)); FileObject fo = null; String attrName = null;
/** Static method to find the Repository to use. * @return Repository instance */ public static Repository getRepository () { initialize (); return repository; }
@Override public void fileRenamed(FileRenameEvent fe) { File f = FileUtil.toFile(fe.getFile()); if ((f != null) && !f.equals(aRoot)) { try { setJarFile(f, false, true); } catch (IOException iex) { ExternalUtil.exception(iex); } catch (PropertyVetoException pvex) { ExternalUtil.exception(pvex); } } }
protected void createData(String name) throws IOException { File f = getFile(name); boolean isError = true; IOException creationException = null; String annotationMsg = null; try { isError = f.createNewFile() ? false : true; isError = isError ? true : (!f.exists()); if (isError) { annotationMsg = NbBundle.getMessage(LocalFileSystem.class, "EXC_DataAlreadyExist", f.getName(), getDisplayName(), f.getAbsolutePath()); creationException = new SyncFailedException(annotationMsg); } } catch (IOException iex) { isError = true; creationException = iex; annotationMsg = iex.getLocalizedMessage(); } if (isError) { LOG.log(Level.INFO, "Trying to create new file {0}.", f.getPath()); ExternalUtil.annotate(creationException, annotationMsg); throw creationException; } }
/** @return the default pool */ public Object readResolve () { return ExternalUtil.getRepository (); } }
private static String decoder(String elem) { try { return URLDecoder.decode(elem, "UTF-8"); // NOI18N } catch (UnsupportedEncodingException e) { ExternalUtil.log(e.getLocalizedMessage()); return URLDecoder.decode(elem); } }
/** Initializes the context and errManager */ private static void initialize () { if (!isInitialized ()) { Lookup l = Lookup.getDefault (); Repository rep = (Repository)l.lookup (org.openide.filesystems.Repository.class); setRepository (rep); } }
if (sepIdx != -1) { String methodName = value.substring(sepIdx+1); Class cls = ExternalUtil.findClass (value.substring(0,sepIdx)); FileObject fo = null; String attrName = null;
/** Static method to find the Repository to use. * @return Repository instance */ public static Repository getRepository () { initialize (); return repository; }
o = m.getAttribute (attrName); } catch (Exception e) { ExternalUtil.annotate (e, "fileName = "+fileName); //NOI18N ExternalUtil.exception (e); return mo == null ? null : mo.get (); } catch (IOException e) { ExternalUtil.log("Cannot load attribute " + attrName + " from " + fileName); // NOI18N ExternalUtil.exception (e); } catch (ClassNotFoundException e) { ExternalUtil.log("Cannot load attribute " + attrName + " from " + fileName); // NOI18N ExternalUtil.exception (e);