Package util.exc

Examples of util.exc.TvBrowserException


    Pattern pattern;
    try {
      pattern = Pattern.compile(regex, flags);
    }
    catch (PatternSyntaxException exc) {
      throw new TvBrowserException(RegexSearcher.class, "error.1",
        "Syntax error in the regular expression of the search pattern!", exc);
    }

    return pattern;
  }
View Full Code Here


  protected boolean downloadFrom(String url) throws TvBrowserException {
    try {
      Launch.openURL("http://www.tvbrowser.org");
    } catch (Exception exc) {
      throw new TvBrowserException(Launch.class, "error.1", "Could not open webbrowser", exc);
    }
   
    return true;
  }
View Full Code Here

        return new RegexSearcher(searchTerm, caseSensitive);
      case SEARCHER_TYPE_BOOLEAN:
        try {
          return new BooleanSearcher(searchTerm, caseSensitive);
        }catch (ParserException e) {
          throw new TvBrowserException(PluginManagerImpl.class, "parser.error","Invalid input: {0}", e.getLocalizedMessage());
        }
      default: throw new IllegalArgumentException("Unknown searcher type: " + type);
    }
  }
View Full Code Here

   * @throws TvBrowserException If the plugin already is in the new state or if
   *           it is not in the required state.
   */
  private void checkStateChange(PluginListItem item, int requiredState, int newState) throws TvBrowserException {
    if (item.getState() == newState) {
      throw new TvBrowserException(PluginProxyManager.class, "error.1",
          "The plugin {0} can not be set to {1}, because it already is {1}.", item.getPlugin().getInfo().getName(),
          getLocalizedStateName(newState));
    }

    if (item.getState() != requiredState) {
      String[] params = { item.getPlugin().getInfo().getName(), getLocalizedStateName(newState),
          getLocalizedStateName(item.getState()), getLocalizedStateName(requiredState) };
      throw new TvBrowserException(PluginProxyManager.class, "error.2",
          "The plugin {0} can not be set to {1}, because is currently {2} and not {3}.", params);
    }
  }
View Full Code Here

    String url = getProperty("downloadtype") == null
        || !getProperty("downloadtype").equalsIgnoreCase("mirrors") ? getProperty("download")
        : downloadUrl + "/" + getProperty("filename");

    if (url == null) {
      throw new TvBrowserException(SoftwareUpdateItem.class, "error.2", "No Url");
    }
    return downloadFrom(url);
  }
View Full Code Here

    final File toFile=new File(Settings.propPluginsDirectory.getString(),getClassName() + ".jar.inst");
    try {
        IOUtilities.download(new URL(url),toFile);
    }catch (Exception exc) {
      throw new TvBrowserException(SoftwareUpdateItem.class, "error.1",
                "Download failed", url,toFile.getAbsolutePath(),exc);
    }
    return true;
  }
View Full Code Here

          monitor.setMessage(mLocalizer.msg("Progressmessage.30",
                  "Parsing channel list"));
        }
        int fileSize = con.getContentLength();
        if (fileSize == 0) {
          throw new TvBrowserException(SweDBTvDataService.class,
              "errorEmptyChannelList",
              "Channel list file for group \"{0}\" is empty: {1}.", group.getName(), url);
        }
        else {
          DataHydraChannelContainer[] DataHydracontainers = DataHydraChannelParser.parse(IOUtilities.openSaveGZipInputStream(con.getInputStream()));

          if (monitor != null) {
            monitor.setMessage(mLocalizer.msg("Progressmessage.40", "Found {0} channels, downloading channel icons...", DataHydracontainers.length));
          }

          mLastGroupUpdate.put(hydraGroup, con.getLastModified());
          con.disconnect();

          ArrayList<Channel> loadedChannels = new ArrayList<Channel>();

          for (DataHydraChannelContainer container : DataHydracontainers) {
            initializeIconLoader(hydraGroup);
            Channel ch = createTVBrowserChannel(hydraGroup, container);
            closeIconLoader(hydraGroup);
            mInternalChannels.put(ch, container);
            loadedChannels.add(ch);
          }

          channels = loadedChannels.toArray(new Channel[loadedChannels.size()]);

          if (monitor != null) {
            monitor.setMessage(mLocalizer.msg("Progressmessage.50",
                    "All channels have been retrieved"));
          }

          /**
           * Update Channel list of the data plugin
           */

          // Remove all Channels of current Group
          Channel[] chs = getAvailableChannels(hydraGroup);
          for (Channel ch : chs) {
            mChannels.remove(ch);
          }

          // Add all Channels for current Group
          mChannels.addAll(loadedChannels);
        }
      } else if (responseCode == 304) {
        channels = getAvailableChannels(hydraGroup);
      } else {
        throw new TvBrowserException(SweDBTvDataService.class,
                "availableResponse",
                "Unknown response during check for available channels in Swedb plugin: {0}", responseCode);
      }
    } catch (Exception e) {
      e.printStackTrace();
      throw new TvBrowserException(SweDBTvDataService.class,
              "checkAvailableError",
              "Error checking for available channels in Swedb plugin: {0}", e
              .getLocalizedMessage());
    }

View Full Code Here

    String country = DayProgramFile.getCountryFromFileName(fileName);
    String channelName = DayProgramFile.getChannelNameFromFileName(fileName);
   
    Channel channel = mDataService.getChannel(country, channelName);
    if (channel == null) {
      throw new TvBrowserException(TvDataBaseUpdater.class, "error.1",
        "Channel not found: {0} from {1}", channelName, country);
    }
   
    addUpdateJob(date, channel);
  }
View Full Code Here

        }
        catch (Exception exc) {
          // This file must be corrupt -> delete it
          file.delete();
         
          throw new TvBrowserException(getClass(), "error.1",
            "Could not load program file {0}. It must be currupt, so it was deleted.",
            file.getAbsolutePath(), exc);
        }
       
        // Include this level
        try {
          prog.merge(levelProg);
        }
        catch (FileFormatException exc) {
          throw new TvBrowserException(getClass(), "error.2",
            "Including level {0} failed", level, exc);
        }
      }
    }
   
    // Convert it into a MutableChannelDayProgram
    try {
      MutableChannelDayProgram target = new MutableChannelDayProgram(date, channel);
      for (int i = 0; i < prog.getProgramFrameCount(); i++) {
        ProgramFrame frame = prog.getProgramFrameAt(i);
        target.addProgram(createProgramFromFrame(frame, date, channel));
      }
      return target;
    }
    catch (TvBrowserException exc) {
      throw new TvBrowserException(getClass(), "error.2",
        "Converting Day program of channel {0} for {1} failed",
        channel, date, exc);
    }
  }
View Full Code Here

    ProgramField field;
   
    // start time
    field = frame.getProgramFieldOfType(ProgramFieldType.START_TIME_TYPE);
    if (field == null) {
      throw new TvBrowserException(getClass(), "error.3",
        "Program frame with ID {0} has no start time.", frame.getId());
    }
    int startTime = field.getTimeData();
   
    MutableProgram program
View Full Code Here

TOP

Related Classes of util.exc.TvBrowserException

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.