Package org.openide.filesystems

Examples of org.openide.filesystems.FileObject


        }
        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 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

        return ivy;
    }

    protected Project getProject() {
        Project[] projects = OpenProjects.getDefault().getOpenProjects();
        FileObject file = getPrimaryFile();
        if (file != null) {
            for (Project project : projects) {
                ProjectPreferences projectPreferences = project.getLookup().lookup(ProjectPreferences.class);
                if (projectPreferences!=null){
                    if (isProjectForFile(projectPreferences, file)){
View Full Code Here

   
    @Override
    public void run() {
        log.finest("Running opening of hyperlinked java file");
       
        FileObject foActionBean = findJavaFile();
        if(null == foActionBean){
            log.fine("Identifier " + targetIdentifier + " not found as a java file");
       
            String message = MessageFormat.format(
                NbBundle.getBundle(this.getClass()).getString("status.action.bean.not.found"),
View Full Code Here

    private FileObject findJavaFile(){
        if(null == srcDoc || null == targetIdentifier){
            return null;
        }
       
        FileObject fo = NbEditorUtilities.getFileObject(srcDoc);
        Project project = FileOwnerQuery.getOwner(fo);
       
       
        String classRelativePath = targetIdentifier.replaceAll("\\.", "/");
        FileObject classFO = null;
       
        classRelativePath +=  ".java";
       
        log.finest("Finding file " + classRelativePath);
       
        for(SourceGroup sg : ProjectUtils.getSources(project).
                getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA)){
           
            FileObject rootFO = sg.getRootFolder();
           
            classFO = rootFO.getFileObject(classRelativePath);
           
            if(null != classFO){
                break;
            }
        }
View Full Code Here

     * @return
     */
    protected Set<FileObject> extendImpl(WebModule wm) {
        EnableFrameworkAction enableFrameworkAction =
                new EnableFrameworkAction(wm, extender.getComponent());
        FileObject webInf = wm.getWebInf();
        if (webInf != null) {
            try {
                FileSystem fs = webInf.getFileSystem();
                fs.runAtomicAction(enableFrameworkAction);
            } catch (IOException e) {
                ErrorManager.getDefault().notify(e);
                return null;
            }
View Full Code Here

        }
        return panels;
    }

    public Set instantiate() throws IOException {
        FileObject targetFolder = Templates.getTargetFolder(wizard);
        DataFolder targetDataFolder = DataFolder.findFolder(targetFolder);
        String targetName = Templates.getTargetName(wizard);
        FileObject templateFileObject = Templates.getTemplate(wizard);
        DataObject templateDataObject = DataObject.find(templateFileObject);

       
        final String extension = "java";
View Full Code Here

            REQUEST
        }

        public void run() throws IOException {
            // MODIFY WEB.XML
            FileObject dd = webModule.getDeploymentDescriptor();
            WebApp webApp = DDProvider.getDefault().getDDRoot(dd);
            Project project = FileOwnerQuery.getOwner(dd);


            addServlet(webApp, DISPATCHER_SERVLET_NAME,
                    DISPATCHER_SERVLET_CLASS, frameworkPanel.getDispatcherUrl(), "1");
           
            Map<String, String> initParams = new HashMap<String, String>(4);
            initParams.put("ActionResolver.Packages", "TODO -- enter comma " +
                    "separated packages with Action Beans here");
            initParams.put("LocalePicker.Locales", getLocalePickerContent(
                    frameworkPanel.getDefaultLocalization(),
                    frameworkPanel.getIncludedLocalizations()));
//            initParams.put("Interceptor.Classes", "net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor");
//            initParams.put("MultipartWrapper.Class", "net.sourceforge.stripes.controller.multipart.CommonsMultipartWrapper");
            addFilter(webApp, "StripesFilter", FILTER_CLASS, frameworkPanel.getFilterUrl(),
                    initParams, FilterMappingDispatcher.REQUEST);

            addFilterMapping(webApp, FILTER_NAME, DISPATCHER_SERVLET_NAME,
                    FilterMappingType.SERVLET_NAME, FilterMappingDispatcher.REQUEST);


           WelcomeFileList welcomeFiles = webApp.getSingleWelcomeFileList();
            if (welcomeFiles == null) {
                try {
                    welcomeFiles = (WelcomeFileList) webApp.createBean("WelcomeFileList");
                    webApp.setWelcomeFileList(welcomeFiles);
                } catch (ClassNotFoundException ex) {
                    Exceptions.printStackTrace(ex);
                }
            }
            if (welcomeFiles.sizeWelcomeFile() == 0) {
                welcomeFiles.addWelcomeFile("index.jsp");
            }

            webApp.write(dd);
            log.info("web.xml modified");

            addFileToOpen(dd);

            // ADD libraries
            addLibraryToWebModule(webModule, STRIPES_LIB_NAME);
            log.info("stripes library added");
            if (frameworkPanel.getIncludeJSTL()) {
                addLibraryToWebModule(webModule, JSTL_LIB_NAME);
                log.info("jstl library added");
            }


            // CREATE FOLDERS FOR FILES
            FileObject webInf = webModule.getWebInf();
            FileObject jspf = webInf.createFolder("jspf");
            FileObject jsp = webInf.createFolder("jsp");
            FileObject layout = webInf.createFolder("layout");
           
            FileObject docBase = webModule.getDocumentBase();
            FileObject css = docBase.createFolder("css");
            FileObject js = docBase.createFolder("js");

            FileObject resourcesRoot = getProjectResourcesRoot(project);


            // COPY TEMPLATE STRIPES RESOURCES (BUNDLES, LAYOUTS, CSS, JS...)
            if(frameworkPanel.getCreateResourcesFile()){
                Locale defaultLang = frameworkPanel.getDefaultLocalization();
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.