Package tvbrowserdataservice.file

Examples of tvbrowserdataservice.file.ChannelList


      try {
        IOUtilities.download(new URL(url), file);
        if (file.canRead() && file.length() > 0) {
          // try reading the file
          devplugin.ChannelGroup group = new devplugin.ChannelGroupImpl(getId(), getName(), null, getProviderName());
          ChannelList channelList = new ChannelList(group);
          channelList.readFromFile(file, mDataService);
          // ok, we can read it, so use this new file instead of the old
          File oldFile = new File(mDataDir, fileName);
          oldFile.delete();
          file.renameTo(oldFile);
          // Invalidate the channel list
View Full Code Here


    if (mAvailableChannelArr == null) {
      File channelFile = new File(mDataDir, getId() + "_" + ChannelList.FILE_NAME);
      if (channelFile.exists()) {
        try {
          devplugin.ChannelGroup group = new devplugin.ChannelGroupImpl(getId(), getName(), null, getProviderName());
          ChannelList channelList = new ChannelList(group);
          channelList.readFromFile(channelFile, mDataService);
          mAvailableChannelArr = channelList.createChannelArray();
        } catch (Exception exc) {
          mLog.log(Level.WARNING, "Loading channellist failed: " + channelFile.getAbsolutePath(), exc);
        }
      }
View Full Code Here

    header();
   
    for (String mGroup : mGroups) {
      byte[] data;
      SummaryFile summary=null;
      ChannelList channelList=null;
      String groupId=null;
      String lastUpdateFileName=null;
       
      groupId = mGroup;
     
      String groupFileName = mGroup+"_info";
      try {
        data = mSource.loadFile(groupFileName);
      }catch(Exception e) {
        printError("Could not load group file '"+groupFileName+"' for group '"+groupId+"'");
      }
       
      String summaryFileName = mGroup+"_summary.gz";
      try {
        data = mSource.loadFile(summaryFileName);
        summary = new SummaryFile();
        summary.readFromStream(new ByteArrayInputStream(data), null);
      } catch (Exception e) {
        printError("Could not load summary file '"+summaryFileName+"' for group '"+groupId+"'");

      }
     
      String channelFileName = mGroup+"_channellist.gz";
      try {
        data = mSource.loadFile(channelFileName);
        channelList = new ChannelList(mGroup);
        channelList.readFromStream(new ByteArrayInputStream(data), null);
      } catch (Exception e) {
          printError("Could not load channel file '"+channelFileName+"' for group '"+groupId+"'");
      }
     
      try {
View Full Code Here

    }
  }


  private ChannelList loadChannelListTxt(String fileName) throws PreparationException {
    ChannelList result = new ChannelList((ChannelGroup)null);

    File fromFile = new File(mConfigDir, fileName);
    try {
      result.readFromStream(new FileInputStream(fromFile), null, false);
    } catch (IOException e) {
      throw new PreparationException("Loading "+fileName+" failed", e);
    } catch (FileFormatException e) {
      throw new PreparationException("Loading "+fileName+" failed", e);
    }
View Full Code Here

    // Read the channel list
    Channel[] channelArr;
    try {
      ByteArrayInputStream stream = new ByteArrayInputStream(data);
     
      ChannelList list = new ChannelList(groupname);
      list.readFromStream(stream, null);
      channelArr = list.createChannelArray();
    }
    catch (Exception exc) {
      throw new UpdateException("Reading channel list for group "+groupname+" failed", exc);
    }
   
View Full Code Here

TOP

Related Classes of tvbrowserdataservice.file.ChannelList

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.