Examples of InputStreamReader


Examples of java.io.InputStreamReader

            if (!replyCode.equals("450") && !replyCode.equals("550") && !replyCode.equals("226")) {
                // get a character input stream to read data from .
                LineNumberReader in = null;
                 try {
                    in = new LineNumberReader(
                            new InputStreamReader(getInputStream(), controlEncoding));
   
                    // read a line at a time
                    String line = null;
                    while ((line = readLine(in)) != null && !cancelTransfer) {
                        if (lines != null)
View Full Code Here

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

Examples of java.io.InputStreamReader

     * @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

Examples of java.io.InputStreamReader

                    .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

Examples of java.io.InputStreamReader

        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

Examples of java.io.InputStreamReader

                    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

Examples of java.io.InputStreamReader

    }

    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

Examples of java.io.InputStreamReader

            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

Examples of java.io.InputStreamReader

        }

        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

Examples of java.io.InputStreamReader

    @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
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.