Package org.openide.filesystems

Examples of org.openide.filesystems.FileSystem


   
    public final static String getFilesystemName(File aFile) {
        Repository Repository = TopManager.getDefault().getRepository();
        Enumeration eFilesystems = Repository.getFileSystems();
        while (eFilesystems.hasMoreElements())
        { FileSystem aFileSystem = (FileSystem) eFilesystems.nextElement();
         
          if (aFile.getPath().indexOf(aFileSystem.getDisplayName()) != -1) {
              return aFileSystem.getDisplayName();
          }
        }
        return "";
    }
View Full Code Here


        }
        catch (PropertyVetoException pve) {
            return;
        }

        FileSystem result;
        try {
            result =
                Repository.getDefault().findFileSystem(jfs.getSystemName());
        }
        catch(Exception exp) {
View Full Code Here

        }
        catch (PropertyVetoException pve) {
            return;
        }

        FileSystem result;
        try {
            result =
                Repository.getDefault().findFileSystem(jfs.getSystemName());
            if(result != null)
                Repository.getDefault().removeFileSystem(result);
View Full Code Here

                "Language not defined for this Parcel Folder");
            TopManager.getDefault().notify(d);
            return;
        }

        FileSystem fs = Repository.getDefault().getDefaultFileSystem();
        DataObject result = null;
        try {
            DataObject dObj = DataObject.find(fs.findResource(sourceFile));
            result = dObj.createFromTemplate(parent);
        }
        catch (IOException ioe) {
            ErrorManager.getDefault().notify(ioe);
        }
View Full Code Here

    * null if no such file system could be found in repository */
    private FileSystem getMountedDocument(File rootFile)
    {
        if (rootFile == null)
            return null;
        FileSystem oofs = null;
        try {
            oofs = Repository.getDefault().findFileSystem(
                OpenOfficeDocFileSystem.computeSystemName(rootFile));
        } catch(Exception exp) {
        }
View Full Code Here

     *
     * @throws java.io.IOException
     */
    @Test
    public void testValidateDirectory() throws IOException {
        FileSystem fileSystem = FileUtil.createMemoryFileSystem();
        FileObject sourceDirectory = fileSystem.getRoot();
        sourceDirectory.createFolder("myfolder");
        sourceDirectory.createData("test.php");

        // existing directory
        YiiCustomizerValidator validator = new YiiCustomizerValidator()
View Full Code Here

        return name;
    }

    public static void generateFile(final FileObject file, String libraryPath, String name, String src, String safeName, String realName) throws IOException {
        try {
            FileSystem fs = file.getFileSystem();
            String text = libraryParser.getTemplate(libraryPath + "/" + src);
            text = text.replaceAll(Pattern.quote("${real_name}"), realName);
            text = text.replaceAll(Pattern.quote("${safe_name}"), safeName);
            final String textOut = text;
            fs.runAtomicAction(new FileSystem.AtomicAction() {

                public void run() throws IOException {
                    FileLock lock = file.lock();
                    try {
                        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(file.getOutputStream(lock)));
View Full Code Here

                }
            }
        } else {
            Stubs stubs = Stubs.getDefault();
            if (stubs != null) {
                FileSystem fs = stubs.getStubs( null ); // PENDING GET NODE VERSION
                if (fs != null) {
                    return fs.getRoot().getFileObject( name + ".js" );
                }
            }
        }
        return null;
    }
View Full Code Here

    private Reference<FileSystem> stubs;

    @Override
    public synchronized FileSystem getStubs(SpecificationVersion ver) {
        FileSystem result = stubs == null ? null : stubs.get();
        if (result == null) {
            result = load();
            stubs = new SoftReference<>(result);
        }
        return result;
View Full Code Here

    private Reference<FileSystem> stubs;

    @Override
    public synchronized FileSystem getStubs(SpecificationVersion ver) {
        FileSystem result = stubs == null ? null : stubs.get();
        if (result == null) {
            result = load();
            stubs = new SoftReference<>(result);
        }
        return result;
View Full Code Here

TOP

Related Classes of org.openide.filesystems.FileSystem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.