Beispiel #1
0
 public void deleteChannel(String channelName) throws IOException {
   synchronized (channelStatus) {
     luceneUpdater.deleteChannel(channelName);
     new File(configFilesDir, channelName + ".config").delete();
     channelStatus.remove(channelName);
   }
 }
Beispiel #2
0
  public void initialize() throws Exception {
    configFilesDir.mkdirs();
    luceneFilesDirectory.mkdirs();
    tempDirectory.mkdirs();

    luceneUpdater.open(luceneFilesDirectory);
    List<Channel> channels = loadChannels();
    for (Channel channel : channels) {
      ChannelStatus cStatus = new ChannelStatus();
      cStatus.channel(channel);
      channelStatus.put(channel.getName(), cStatus);
    }
  }
Beispiel #3
0
 public void renameChannel(Channel channel, String newName) throws Exception {
   synchronized (channelStatus) {
     luceneUpdater.renameChannel(channel.getName(), newName);
     new File(configFilesDir, channel.getName() + ".config").delete();
     ChannelStatus cStatus = channelStatus.remove(channel.getName());
     if (cStatus != null) {
       channel.setName(newName);
       cStatus.channel(channel);
       channelStatus.put(newName, cStatus);
       saveChannel(channel);
     }
   }
 }