예제 #1
0
 public void deleteChannel(String channelName) throws IOException {
   synchronized (channelStatus) {
     luceneUpdater.deleteChannel(channelName);
     new File(configFilesDir, channelName + ".config").delete();
     channelStatus.remove(channelName);
   }
 }
예제 #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);
    }
  }
예제 #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);
     }
   }
 }