Package org.openide.filesystems

Examples of org.openide.filesystems.FileObject.asText()


            }
            FileObject file = folder.getFileObject(name, "js");
            if (file == null) {
                file = folder.createData(name, "js");
            }
            if (!file.asText().equals(js)) {
                OutputStream out = file.getOutputStream();
                try {
                    out.write(js.getBytes(encoding));
                    out.flush();
                } finally {
View Full Code Here


    public String getRunArguments () {
        FileObject fo = project.getProjectDirectory().getFileObject( ".nbrun" ); //NOi18N
        if (fo != null) {
            try {
                return fo.asText().trim();
            } catch ( IOException ex ) {
                Exceptions.printStackTrace( ex );
            }
        }
        return null;
View Full Code Here

        FileObject phpUnitScript = nbproject.getFileObject(scriptFileName);
        FileObject script = FileUtil.getConfigFile(CONFIG_PATH + scriptFileName);

        // over write phpunit script (phpunit.php)
        try {
            String format = String.format(script.asText(UTF8), phpUnit);
            PrintWriter pw;
            if (phpUnitScript == null) {
                pw = new PrintWriter(new OutputStreamWriter(nbproject.createAndOpen(scriptFileName), UTF8));
            } else {
                pw = new PrintWriter(new OutputStreamWriter(phpUnitScript.getOutputStream(), UTF8));
View Full Code Here

        }

        // set text to options
        FuelPhpOptions options = FuelPhpOptions.getInstance();
        try {
            options.setDefaultConfig(config.asText("UTF-8")); // NOI18N

            // open dialog
            NotifyDescriptor descriptor = new NotifyDescriptor(
                    "Success : Set source code of config.php to Options",
                    getPureName(),
View Full Code Here

                sourceText = getDocumentText(sourceDoc);
            }
        }
        if (sourceText == null) {
            FileObject sourceFile = context.getPrimaryFile();
            sourceText = sourceFile.asText();
        }
        return sourceText;
    }

    private String getDocumentText(final Document sourceDoc) {
View Full Code Here

            LOGGER.log(Level.WARNING, Bundle.CreatePermalinkHtaccessAction_error(Bundle.CreatePermalinkHtaccessAction_error_template()));
            return;
        }
        String contents = null;
        try {
            contents = template.asText("UTF-8"); // NOI18N
        } catch (IOException ex) {
            Exceptions.printStackTrace(ex);
        }
        if (contents == null || contents.isEmpty()) {
            LOGGER.log(Level.WARNING, Bundle.CreatePermalinkHtaccessAction_error(Bundle.CreatePermalinkHtaccessAction_error_template_text()));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.