/** 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 (); }
/** 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 (); }
/** @return the default pool */ public Object readResolve () { return ExternalUtil.getRepository (); } }
/** @return the default pool */ public Object readResolve () { return ExternalUtil.getRepository (); } }
/** Returns <code>true</code> if the filesystem is default one of the IDE. * @see Repository#getDefaultFileSystem */ public final boolean isDefault () { return this == ExternalUtil.getRepository ().getDefaultFileSystem (); }
private void readObject (ObjectInputStream ois) throws IOException, ClassNotFoundException { ExternalUtil.getRepository ().readExternal (ois); }
/** Returns <code>true</code> if the filesystem is default one of the IDE. * @see Repository#getDefaultFileSystem */ public final boolean isDefault () { return this == ExternalUtil.getRepository ().getDefaultFileSystem (); }
private void readObject (ObjectInputStream ois) throws IOException, ClassNotFoundException { ExternalUtil.getRepository ().readExternal (ois); }
private void writeObject (ObjectOutputStream oos) throws IOException { ExternalUtil.getRepository ().writeExternal (oos); }
private void writeObject (ObjectOutputStream oos) throws IOException { ExternalUtil.getRepository ().writeExternal (oos); }
private static FileObject oldDecode(URL u) { String resourceName = u.getFile(); if (resourceName.startsWith("/")) resourceName = resourceName.substring(1); // NOI18N // first part is FS name int first = resourceName.indexOf('/'); // NOI18N if (first == -1) return null; String fileSystemName = oldDecodeFSName(resourceName.substring(0, first)); resourceName = resourceName.substring(first); FileSystem fsys = ExternalUtil.getRepository().findFileSystem(fileSystemName); return (fsys == null) ? null : fsys.findResource(resourceName); }
private static FileObject oldDecode(URL u) { String resourceName = u.getFile(); if (resourceName.startsWith("/")) resourceName = resourceName.substring(1); // NOI18N // first part is FS name int first = resourceName.indexOf('/'); // NOI18N if (first == -1) return null; String fileSystemName = oldDecodeFSName(resourceName.substring(0, first)); resourceName = resourceName.substring(first); FileSystem fsys = ExternalUtil.getRepository().findFileSystem(fileSystemName); return (fsys == null) ? null : fsys.findResource(resourceName); }
/** All filesystems that are capable of this capability. * @return enumeration of FileSystems that satifies this capability * @deprecated Please use the <a href="@JAVA/API@/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead. */ public Enumeration fileSystems () { class FFS implements org.openide.util.Enumerations.Processor { public Object process (Object obj, Collection ignore) { FileSystem fs = (FileSystem)obj; return fs.getCapability().capableOf(FileSystemCapability.this) ? fs : null; } } return org.openide.util.Enumerations.filter ( ExternalUtil.getRepository ().fileSystems (), new FFS () ); }
/** All filesystems that are capable of this capability. * @return enumeration of FileSystems that satifies this capability * @deprecated Please use the <a href="@JAVA/API@/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead. */ public Enumeration fileSystems () { class FFS implements org.openide.util.Enumerations.Processor { public Object process (Object obj, Collection ignore) { FileSystem fs = (FileSystem)obj; return fs.getCapability().capableOf(FileSystemCapability.this) ? fs : null; } } return org.openide.util.Enumerations.filter ( ExternalUtil.getRepository ().fileSystems (), new FFS () ); }
/** Finds the right file. */ public Object readResolve () { Repository rep = ExternalUtil.getRepository (); FileSystem fs = rep.findFileSystem (fsName); FileObject fo = null; if (fs != null) { // scan desired system fo = fs.findResource (fileName); } if (fo == null) { // create invalid file instead return new Invalid (fsName, fileName); } return fo; }
/** Finds the right file. */ public Object readResolve () { Repository rep = ExternalUtil.getRepository (); FileSystem fs = rep.findFileSystem (fsName); FileObject fo = null; if (fs != null) { // scan desired system fo = fs.findResource (fileName); } if (fo == null) { // create invalid file instead return new Invalid (fsName, fileName); } return fo; }
/** * Gets FileObject for passed url. * @param url * @return appropriate FileObject. Can return null for other protocol than nbfs or * if such FileObject isn't reachable via Repository. */ static FileObject getFileObject(URL url) { if (!url.getProtocol().equals(FileURL.PROTOCOL)) return null; if (isOldEncoding(url)) { return oldDecode(url); } String[] urlParts = split(url); String fsName = decodeFsPart(urlParts[0]) ; String foName = decodeFoPart(urlParts[1]); FileSystem fsys = ExternalUtil.getRepository().findFileSystem(fsName); return (fsys == null) ? null : fsys.findResource(foName); }
/** * Gets FileObject for passed url. * @param url * @return appropriate FileObject. Can return null for other protocol than nbfs or * if such FileObject isn't reachable via Repository. */ static FileObject getFileObject(URL url) { if (!url.getProtocol().equals(FileURL.PROTOCOL)) return null; if (isOldEncoding(url)) { return oldDecode(url); } String[] urlParts = split(url); String fsName = decodeFsPart(urlParts[0]) ; String foName = decodeFoPart(urlParts[1]); FileSystem fsys = ExternalUtil.getRepository().findFileSystem(fsName); return (fsys == null) ? null : fsys.findResource(foName); }