Package java.io

Examples of java.io.FileInputStream


        File file = getLayoutFile();
        if (file != null && file.canRead()) {
            Assert.isTrue(SwingUtilities.isEventDispatchThread());
            Assert.isTrue(rootComponent.isVisible());

            FileInputStream inputStream = new FileInputStream(file);

            // load layout, but add the requested content before (via callback)!
            toolWindowManager.getPersistenceDelegate().merge(
                    inputStream, MergePolicy.UNION,
                    new PersistenceDelegateCallback() {

//                        @Override
//                        public ToolWindow toolwindowNotFound(ToolWindowManager toolWindowManager, String toolWindowId, PersistenceNode node) {
//                            //logger.info("'toolwindow not found' Not supported yet.");
//                            return null;
//                        }
//
//                        @Override
//                        public Content contentNotFound(ToolWindowManager toolWindowManager, String contentId, PersistenceNode node) {
//                            addView(contentId);
//                            return contentAndPageComponentById.get(contentId).getKey();
//                        }
//
//                        @Override
//                        public String validate(PersistenceNode node, String attribute, String attributeValue, Object attributeDefaultValue) {
//                            return attributeValue;
//                        }
                        @Override
                        public Content contentNotFound(ToolWindowManager toolWindowManager, String contentId) {
                            addView(contentId);
                            return contentAndPageComponentById.get(contentId).getKey();
                        }
                    });
            inputStream.close();
            logger.info("Loaded " + contentManager.getContentCount() + " view(s).");
            return true;
        }
        return false;
    }
View Full Code Here


      WGADesignerPlugin.getDefault().logError("Unable to load runtime configuration.", e);
    }
  }

  public WGARuntimeConfiguration reloadConfig() throws FileNotFoundException, Exception {
    FileInputStream configFileStream = null;
    try {
      configFileStream = new FileInputStream(getConfigFile().getLocation().toFile());
      _config = WGARuntimeConfiguration.read(configFileStream);
    } finally {
      if (configFileStream != null) {
        try {
          configFileStream.close();
        } catch (IOException e) {
        }
      }
    }
View Full Code Here

        return config;
      }
    } else {

      synchronized (_wgaConfigLock) {
        FileInputStream wgaXMLStream = null;
        try {
          wgaXMLStream = new FileInputStream(wgaXML.getLocation().toFile());
          WGAConfiguration conf = WGAConfiguration.read(wgaXMLStream);
          return conf;
        } catch (Exception e) {
          IncompatibleWGAConfigVersion notConfigurable = new IncompatibleWGAConfigVersion("Unable to read wga configuration.", e);
          throw notConfigurable;
        } finally {
          if (wgaXMLStream != null) {
            try {
              wgaXMLStream.close();
            } catch (IOException e) {
            }
          }
        }
      }
View Full Code Here

        properties.put("javafx_home", "C:\\Program Files\\NetBeans 6.5\\javafx2\\javafx-sdk");

        Set<File> files = new FastSet<File>();
        files.add(new File(mavenRepoPath + "\\de\\timefinder\\timefinder-core\\2009-v1\\timefinder-core-2009-v1.jar"));

        Document doc = doc = Helper.parse(new FileInputStream("../pom.xml"));
        fillProperties(doc);
        fillDependencies(files, doc);

        doc = Helper.parse(new FileInputStream("pom.xml"));
        fillProperties(doc);
        fillDependencies(files, doc);

        String destinationDir = ".\\target\\all";
        new File(destinationDir).mkdir();
View Full Code Here

            @Override
            protected void myconstruct() throws Exception {
                bar.getProgressMonitor().worked(10);

                XmlImport importer = new XmlImport(dataPool, settings,
                        new FileInputStream(file.getAbsolutePath()));

                // TODO NOW
//                importer.setStatusBar(bar);

                importer.doWork();
View Full Code Here

            ImportBTXml.overwriteSettings(settings);
            ImportBTXml importer = new ImportBTXml(dataPool, fileOrFolder);
            importer.setDataPoolSettings(settings);
            importer.doWork();
        } else {
            InputStreamReader reader = new InputStreamReader(new FileInputStream(fileOrFolder));

            DataPool4Track2 dataPool4Track2 = new DataPool4Track2();
            dataPool4Track2.setSettings(settings);
            dataPool4Track2.setDataPool(dataPool);
            dataPool4Track2.setSource(reader);
View Full Code Here

            }
            return;
        }

        try {
            new XmlImport(dataPool, dataSettings, new FileInputStream(storageFile)).doWork();
        } catch (IOException ex) {
            logger.fatal("Couldn't auto-import from:" + storageFile, ex);
        }
    }
View Full Code Here

    public static void main(String[] args) throws Exception {
        String file = "C:\\Users\\btn417\\Documents\\sessions_catalog.j1";
//        String file = "/home/peterk/sessions_catalog.j1";
        final List list = new ImportJavaOne().parse(
                new FileInputStream(file));
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                JFrame frame = new JFrame("TimeFinder Planner");
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
View Full Code Here

   
    public static Properties load(String fileName) throws IOException {
        InputStream is = null;
        try {
            Properties props = new Properties();
            is = new FileInputStream(fileName);
            props.load(is);
            return props;
        } finally {
            if (is != null) {
                is.close();
View Full Code Here

        try {
            refFileLength = writer.getPdfIndirectReference();
            if (fileStore == null) {
                File file = new File(filePath);
                if (file.canRead()) {
                    in = new FileInputStream(filePath);
                }
                else {
                    if (filePath.startsWith("file:/") || filePath.startsWith("http://") || filePath.startsWith("https://") || filePath.startsWith("jar:")) {
                        in = new URL(filePath).openStream();
                    }
View Full Code Here

TOP

Related Classes of java.io.FileInputStream

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.