Package org.openide.filesystems

Examples of org.openide.filesystems.FileObject


            ParcelCookie parcelCookie =
                (ParcelCookie)sourceParcel.getCookie(ParcelCookie.class);
            parcelCookie.deploy(targetDocument);

            if (isCut == true) {
                FileObject fo = sourceParcel.getDataObject().getPrimaryFile();
                try {
                    fo.delete();
                }
                catch (IOException ioe) {}
                return ExTransferable.EMPTY;
            }
            else {
View Full Code Here


        }
        catch (IOException ioe) {
            ErrorManager.getDefault().notify(ioe);
        }

        FileObject fo = result.getPrimaryFile();
        if (fo.getExt().equals("java")) {
            FileLock lock = null;
            try {
                PackageRemover.removeDeclaration(FileUtil.toFile(fo));

                // IssueZilla 11986 - rename the FileObject
                // so the JavaNode is resynchronized
                lock = fo.lock();
                if (lock != null) {
                    fo.rename(lock, fo.getName(), fo.getExt());
                }
            }
            catch (IOException ioe) {
                NotifyDescriptor d = new NotifyDescriptor.Message(
                 "Error removing package declaration from file: " +
                 fo.getNameExt() +
                 ". You should manually remove this declaration " +
                 "before building the Parcel Recipe");
                TopManager.getDefault().notify(d);
            }
            finally {
View Full Code Here

    private OfficeDocument document;
    private Set listeners;

    public OfficeDocumentSupport(OfficeDocumentDataObject dataObj) {
        this.dataObj = dataObj;
        FileObject fo = dataObj.getPrimaryFile();
        try {
            this.document = new OfficeDocument(FileUtil.toFile(fo));
        }
        catch (Exception e) {
            e.printStackTrace();
        }
        fo.addFileChangeListener(this);
    }
View Full Code Here

            }
        }
    }

    private ParcelDescriptor getParcelDescriptor() {
        FileObject primary = parcelFolder.getPrimaryFile();

        File contents = FileUtil.toFile(
            primary.getFileObject(ParcelZipper.CONTENTS_DIRNAME));

        return ParcelDescriptor.getParcelDescriptor(contents);
    }
View Full Code Here

    public void generate() {
        ParcelFolder.ParcelFolderNode node =
            (ParcelFolder.ParcelFolderNode)parcelFolder.getNodeDelegate();
       
        FileObject parcelBase = parcelFolder.getPrimaryFile();
        FileObject contentsBase =
            parcelBase.getFileObject(ParcelZipper.CONTENTS_DIRNAME);
       
        File parcelDir = FileUtil.toFile(parcelBase);
        File contentsDir = FileUtil.toFile(contentsBase);
       
View Full Code Here

        }
    }
       
    public boolean configure() {

        FileObject primary = parcelFolder.getPrimaryFile();

        File contents = FileUtil.toFile(
            primary.getFileObject(ParcelZipper.CONTENTS_DIRNAME));

        Vector classpath = getConfigureClasspath();
        classpath.addElement(contents.getAbsolutePath());
       
        try {
View Full Code Here

    protected void performAction(Node[] activatedNodes) {
        if(activatedNodes.length != 1) {
            return;
        }

        FileObject fo = getFileObject(activatedNodes[0]);
        CodeSnifferBuilder.createOrReturn().execute(fo, true);
    }
View Full Code Here

     */
    private FileObject getFileObject(Node node)
    {
        assert node != null;

        FileObject fileObj = node.getLookup().lookup(FileObject.class);
        if (fileObj != null && fileObj.isValid()) {
            return fileObj;
        }
        DataObject dataObj = node.getCookie(DataObject.class);
        if (dataObj == null) {
            return null;
        }
        fileObj = dataObj.getPrimaryFile();
        if (fileObj != null && fileObj.isValid()) {
            return fileObj;
        }
        return null;
    }
View Full Code Here

                .setDefaultWorkingDirectory(FileUtil.toFile(source))
                .forceUseOfDefaultWorkingDirectory(true)
                .showOpenDialog();
        if (appDirectory != null) {
            appDirectory = FileUtil.normalizeFile(appDirectory);
            FileObject fo = FileUtil.toFileObject(appDirectory);
           
            if (FileUtil.isParentOf(source, fo)) {
                // it is ok
                String relativePath = FileUtil.getRelativePath(source, fo);
                assert relativePath != null : source + " not parent of " + fo;
View Full Code Here

    /**
     * @return console script or {@code null} if not valid
     */
    public static FileObject getPath(PhpModule phpModule) {
        FileObject sourceDirectory = phpModule.getSourceDirectory();

        if (sourceDirectory == null) {
            // broken project
            return null;
        }

        return sourceDirectory.getFileObject(SCRIPT_NAME);
    }
View Full Code Here

TOP

Related Classes of org.openide.filesystems.FileObject

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.