Package org.openide.filesystems

Examples of org.openide.filesystems.FileObject


                stmt.execute(BaseClass.getDropString(toString(), ObjectType));
                ou.OutputMsg(Utils.getBundle().getString("LBL_Done"), null, false);
                File f = new File(getLocalFile());
                if (f.exists()) {
                    try {
                        FileObject file = FileUtil.toFileObject(f);
                        DataObject dob = DataObject.find(file);
                        CloseCookie cookie = dob.getCookie(CloseCookie.class);
                        if (cookie != null) {
                            cookie.close();
                        }
View Full Code Here


            task = rp.create(new Runnable() {

                public void run() {
                    File selFile = returnLocalFile();
                    FileObject file;
                    DataObject dob = null;
                    Statement stmt = null;
                    OracleConnection conn = null;
                    try {
                        file = FileUtil.toFileObject(selFile);
View Full Code Here

    @Override
    public void actionPerformed(ActionEvent e) {
        Project proj = OpenProjects.getDefault().getMainProject();
        if (proj != null) {
            try {
                FileObject root = proj.getProjectDirectory();
                final String path = root.getPath();
                File f = new File(path + "/assets");

                AssetFolder assetFolder = AssetsBuilder.getInstance().build(f);
    //            JCodeModel jcm = new JCodeModel();
    //            try {
View Full Code Here

    /** Creates a new instance of BuildExtension */
    private BuildExtension() {
    }
   
    static void copyTemplate(Project proj) throws IOException {
        FileObject projDir = proj.getProjectDirectory();
        FileObject jnlpBuildFile = projDir.getFileObject("nbproject/extendRun.xml"); // NOI18N
        if (jnlpBuildFile == null) {
            FileSystem sfs = Repository.getDefault().getDefaultFileSystem();
            FileObject templateFO = sfs.findResource("Templates/SunResources/extendRun.xml"); // NOI18N
            if (templateFO != null) {
                FileUtil.copyFile(templateFO, projDir.getFileObject("nbproject"), "extendRun"); // NOI18N
            }
        }
    }
View Full Code Here

            }
        }
    }
   
    static void removeTemplate(Project proj) throws IOException {
        FileObject projDir = proj.getProjectDirectory();
        FileObject jnlpBuildFile = projDir.getFileObject("nbproject/extendRun.xml"); // NOI18N
        if (jnlpBuildFile != null) {
            jnlpBuildFile.delete();
        }
    }
View Full Code Here

            jnlpBuildFile.delete();
        }
    }

    static void extendBuildXml(Project proj, String target) throws IOException {
        FileObject projDir = proj.getProjectDirectory();
        final FileObject buildXmlFO = projDir.getFileObject("build.xml"); // NOI18N
        if (null == buildXmlFO) {
            // eject
            return;
        }
        File buildXmlFile = FileUtil.toFile(buildXmlFO);
        try {
            XMLUtil.parse(new InputSource(buildXmlFile.toURI().toString()), false, true, null, null);
        } catch (SAXException ex) {
            Exceptions.printStackTrace(ex);
        }
        FileObject jnlpBuildFile = projDir.getFileObject("nbproject/extendRun.xml"); // NOI18N
        AntBuildExtender extender = proj.getLookup().lookup(AntBuildExtender.class);
        if (extender != null) {
            if (extender.getExtension("sfrunextend") == null) { // NOI18N
                AntBuildExtender.Extension ext = extender.addExtension("sfrunextend", jnlpBuildFile); // NOI18N
                ext.addDependency(target, "-extend-run"); // NOI18N
View Full Code Here

                    "Trying to include SF build snippet in project type that doesn't support AntBuildExtender API contract."); // NOI18N
        }
    }
   
    static void abbreviateBuildXml(Project proj, String target) throws IOException {
        FileObject projDir = proj.getProjectDirectory();
        final FileObject buildXmlFO = projDir.getFileObject("build.xml"); // NOI18N
        if (null == buildXmlFO) {
            // eject
            return;
        }
        File buildXmlFile = FileUtil.toFile(buildXmlFO);
View Full Code Here

        super(n, d);
    }

    public Set extend(WebModule wm) {
        Set retVal = new HashSet();
        final FileObject documentBase = wm.getDocumentBase();
        Project project = FileOwnerQuery.getOwner(documentBase);

        Library sipLibrary = LibraryManager.getDefault().getLibrary(libname);
        Sources s = project.getLookup().lookup(Sources.class);
        SourceGroup[] sources = null;
View Full Code Here

        }
        return retVal;
    }

    public File[] getConfigurationFiles(WebModule wm) {
        FileObject sip = wm.getWebInf().getFileObject("sip.xml");       //NOI18N
        if (null != sip) {
            File[] configFiles = new File[1];
            configFiles[0] = FileUtil.toFile(sip);
            return configFiles;
        } else {
View Full Code Here

            public void removeChangeListener(ChangeListener l) {
            }
    }

    public boolean isInWebModule(org.netbeans.modules.web.api.webmodule.WebModule wm) {
        FileObject webInf = wm.getWebInf();
        return webInf == null ? false :
            webInf.getFileObject("sip.xml") != null;            // NOI18N
       
//        final FileObject documentBase = wm.getDocumentBase();
//        Project project = FileOwnerQuery.getOwner(documentBase);
//
//        Library sipLibrary = LibraryManager.getDefault().getLibrary(libname);
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.