Package util.io.stream

Examples of util.io.stream.InputStreamProcessor


  public DefaultSettings() {
    mProperties = new Properties();
    File settingsFile = new File(FILENAME);
    if (settingsFile.canRead() && !TVBrowser.isTransportable()) {
      StreamUtilities.inputStreamIgnoringExceptions(settingsFile,
          new InputStreamProcessor() {

            @Override
            public void process(InputStream input) throws IOException {
              mProperties.load(input);
            }
View Full Code Here


  public void parse(final TvDataUpdateManager updateManager, final Date endDate) throws Exception {
    StringBuilder urlString = new StringBuilder(RadioTimesDataService.BASEURL);
    urlString.append(mChannel.getId().substring(RadioTimesDataService.RADIOTIMES.length()));
    urlString.append(".dat");

    StreamUtilities.inputStream(new URL(urlString.toString()), new InputStreamProcessor() {

      @Override
      public void process(InputStream inputStream) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF8"));
View Full Code Here

        mLog.warning(arg0);
      }});
    try {
      File dictionary = new File(HYPHEN_DICT_FILENAME);
      if (dictionary.exists()) {
        StreamUtilities.inputStream(HYPHEN_DICT_FILENAME, new InputStreamProcessor() {

          @Override
          public void process(InputStream input) throws IOException {
            hyphenator.loadTable(input);
            useHyphenator = true;
View Full Code Here

    File file = new File(mDataDir, getId() + "_info");
    if (!file.exists()) { return ""; }
    final Properties prop = new Properties();
    // TODO init all props at once
    StreamUtilities.inputStreamIgnoringExceptions(file,
        new InputStreamProcessor() {
          public void process(InputStream input) throws IOException {
            prop.load(input);
          }
        });
    mDescription = getLocaleProperty(prop, "description", "");
View Full Code Here

    File file = new File(mDataDir, getId() + "_info");
    if (!file.exists()) { return getId(); }

    final Properties prop = new Properties();
    try {
      StreamUtilities.inputStream(file, new InputStreamProcessor() {
        public void process(InputStream input) throws IOException {
          prop.load(input);
        }
      });
      Locale locale = Locale.getDefault();
View Full Code Here

    }
    File file = new File(mDataDir, getId() + "_info");
    if (!file.exists()) { return ""; }
    final Properties prop = new Properties();
    try {
      StreamUtilities.inputStream(file, new InputStreamProcessor() {
        public void process(InputStream input) throws IOException {
          prop.load(input);
        }
      });
      providerName = prop.getProperty("provider",mLocalizer.msg("unknownProvider","unknown"));
View Full Code Here

    boolean loaded = true;

    File file = new File(getUserPropertiesFileName(locale));
    if (file.exists()) {
      try {
        StreamUtilities.inputStream(file, new InputStreamProcessor() {
          public void process(InputStream input) throws IOException {
            newProp.load(input);
          }
        });
      } catch (IOException e) {
View Full Code Here

    uc.setRequestProperty("Authorization", "Basic " + encoded);

    if (uc instanceof HttpURLConnection) {
      if (((HttpURLConnection) uc).getResponseCode() != HttpURLConnection.HTTP_OK) {
        InputStream content = ((HttpURLConnection) uc).getErrorStream();
        StreamUtilities.inputStream(content, new InputStreamProcessor() {

          @Override
          public void process(InputStream input) throws IOException {
            BufferedReader in = new BufferedReader(new InputStreamReader(input));
            String line;
            while ((line = in.readLine()) != null) {
              result.append(line);
            }
          }
        });
        mError = true;
        mExitValue = 1;
        return result.toString();
      }
    }

    StreamUtilities.inputStream(uc, new InputStreamProcessor() {

      @Override
      public void process(InputStream input) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(input));
        String line;
View Full Code Here

        File oldTvDataDir = null;

        final Properties prop = new Properties();

        try {
          StreamUtilities.inputStream(testFile, new InputStreamProcessor() {
            public void process(InputStream input) throws IOException {
              prop.load(input);
            }
          });
        }catch(Exception e) {}
View Full Code Here

TOP

Related Classes of util.io.stream.InputStreamProcessor

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.