Package java.io

Examples of java.io.InputStreamReader


    m_structure    = null;
    m_sourceFile   = null;
    m_File         = null;
    m_FirstCheck     = true;

    m_sourceReader = new BufferedReader(new InputStreamReader(input));
  }
View Full Code Here


     * @param inStream stream from which the messages are read
     * @throws IOException if there is any problem with reading the messages
     */
    private static synchronized void _loadMessages(InputStream inStream) throws IOException {
       
        InputStreamReader in = new InputStreamReader(inStream);
        while (true) {
            // Get next line
            String line = _readLine(in);
            if (line == null)
                return;
View Full Code Here

                    .append(newLine);
            InputStream errorStream = m_connection.getErrorStream();
            if (m_interceptor != null) {
                errorStream = m_interceptor.intercept(errorStream);
            }
            BufferedReader in = new BufferedReader(new InputStreamReader(errorStream));
            String line;
            while ((line = in.readLine()) != null) {
                error.append(line).append(newLine);
            }
            return error.toString();
View Full Code Here

        Reader reader = null;
        try {
          if(!_metadataFile.isSynchronized(IResource.DEPTH_ZERO)){
            _metadataFile.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
          }
          reader = new InputStreamReader(_metadataFile.getContents(), _fileEncoding);
          TMLMetadataInfo metaData = (TMLMetadataInfo) xstream.fromXML(reader);
          directAccess = metaData.isDirectAccess();
          cacheable = metaData.isCacheable();
          description = metaData.getDescription();
          category = metaData.getCategory();
View Full Code Here

                    DataHandler dataHandler = (DataHandler) ((OMText) o).getDataHandler();
                    if (dataHandler != null) {
                        BufferedReader reader = null;
                        try {
                            reader = new BufferedReader(
                                    new InputStreamReader(dataHandler.getInputStream()));
                            scriptEngine.eval(reader);

                        } catch (IOException e) {
                            handleException("Error in reading script as a stream ", e, synCtx);
                        } finally {

                            if (reader != null) {
                                try {
                                    reader.close();
                                } catch (IOException e) {
                                    handleException("Error in closing input stream ", e, synCtx);
                                }
                            }

                        }
                    }
                }

            }
        }

        // load <include /> scripts; reload each script if needed
        for (Value includeKey : includes.keySet()) {

            String includeSourceCode = (String) includes.get(includeKey);

            String generatedKey = includeKey.evaluateValue(synCtx);

            Entry includeEntry = synCtx.getConfiguration().getEntryDefinition(generatedKey);
            boolean includeEntryNeedsReload = (includeEntry != null) && includeEntry.isDynamic()
                    && (!includeEntry.isCached() || includeEntry.isExpired());
            synchronized (resourceLock) {
                if (includeSourceCode == null || includeEntryNeedsReload) {
                    log.debug("Re-/Loading the include script with key " + includeKey);
                    Object o = synCtx.getEntry(generatedKey);
                    if (o instanceof OMElement) {
                        includeSourceCode = ((OMElement) (o)).getText();
                        scriptEngine.eval(includeSourceCode);
                    } else if (o instanceof String) {
                        includeSourceCode = (String) o;
                        scriptEngine.eval(includeSourceCode);
                    } else if (o instanceof OMText) {

                        DataHandler dataHandler = (DataHandler) ((OMText) o).getDataHandler();
                        if (dataHandler != null) {
                            BufferedReader reader = null;
                            try {
                                reader = new BufferedReader(
                                        new InputStreamReader(dataHandler.getInputStream()));
                                scriptEngine.eval(reader);

                            } catch (IOException e) {
                                handleException("Error in reading script as a stream ", e, synCtx);
                            } finally {
View Full Code Here

    }

    private DataPool4Track2 createDP4Track2() {
        InputStream iStream = NoCollisionPrinciple.class.getResourceAsStream(TIM_FILE);
        assertNotNull(iStream);
        InputStreamReader reader = new InputStreamReader(iStream);
        DataPool4Track2 dataPool4Track2 = new DataPool4Track2();
        dataPool4Track2.setSettings(settings);
        dataPool4Track2.setDataPool(dataPool);
        dataPool4Track2.setSource(reader);
        ncpInstance.setDataPool(dataPool4Track2.getDataPool());
View Full Code Here

            if( aboutTextPath != null ) {
                // Add in the application descriptor data, if available
                dialogPanel.add(createApplicationDescriptorComponent(), BorderLayout.NORTH);
                try {
                    scroller = new HtmlScroller(false, 2000, 15, 10);
                    String text = FileCopyUtils.copyToString(new BufferedReader(new InputStreamReader(aboutTextPath
                            .getInputStream())));
                    scroller.setHtml(text);
                } catch( IOException e ) {
                    final IllegalStateException exp = new IllegalStateException("About text not accessible: "
                            + e.getMessage());
View Full Code Here

        }

        protected void onAboutToShow() {
            if( scroller != null ) {
                try {
                    String text = FileCopyUtils.copyToString(new BufferedReader(new InputStreamReader(aboutTextPath
                            .getInputStream())));
                    scroller.setHtml(text);
                }
                catch (IOException e) {
                    final IllegalStateException exp =
View Full Code Here

    @Override
    protected void initReaders() {
        try {
            eventAssignmentReader = new BufferedReader(
                    new InputStreamReader(new FileInputStream(new File(getFolder(), eventAssignmentFile)), "cp1252"));
        } catch (Exception ex) {
            logger.fatal("Konnte Datei nicht öffnen " + eventAssignmentFile, ex);
        }

        try {
            courseInstancesReader = new BufferedReader(
                    new InputStreamReader(new FileInputStream(new File(getFolder(), courseInstancesFile)), "cp1252"));
        } catch (Exception ex) {
            logger.fatal("Konnte Datei nicht öffnen " + courseInstancesFile, ex);
        }
    }
View Full Code Here

                    String str = "http://timefinder.sourceforge.net/files/comp-2007-2-09.tim";
                    bar.setMessage(tr.get("downloadFrom", str));
                    // why does decompressing not work?? -> first line == null !?
                    // reader = new InputStreamReader(new ZipInputStream(
                    //          new UrlResource("http://timefinder.sourceforge.net/files/comp-2007-2-09.zip").getInputStream()));
                    reader = new InputStreamReader(new UrlResource(str).getInputStream());
                    bar.setMessage("");
                }

                track2allData.setSource(reader);
                track2allData.setStatusBar(new StatusBarBridge(bar));
View Full Code Here

TOP

Related Classes of java.io.InputStreamReader

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.