예제 #1
0
파일: Files.java 프로젝트: Carlgo11/Arisu
 public static void loadChannels(Arisu ar) throws Exception {
   File file = new File("channels.txt");
   if (!file.exists()) {
     file.createNewFile();
   }
   BufferedReader read = new BufferedReader(new FileReader(file));
   String line;
   while ((line = read.readLine()) != null) {
     if (!ar.channels.contains(line)) {
       if (!line.startsWith("!") && !line.isEmpty()) {
         ar.channels.add(line);
         ar.joinChannel(line);
         Files.loadlog(ar, line);
       }
     }
   }
   System.out.println("loaded channels.txt");
   System.out.println("channels: " + ar.channels.toString());
 }
예제 #2
0
파일: Files.java 프로젝트: Carlgo11/Arisu
 public static void loadlog(Arisu ar, String channel) throws Exception {
   File dir = new File("logs");
   if (!dir.exists()) {
     dir.mkdir();
   }
   File file = new File(dir + "/" + channel + ".log");
   if (!file.exists()) {
     file.createNewFile();
   }
   BufferedReader read = new BufferedReader(new FileReader(file));
   String line;
   while ((line = read.readLine()) != null) {
     if (!ar.log.contains(line)) {
       if (!line.startsWith("!") && !line.isEmpty()) {
         ar.log.add(line);
         ar.joinChannel(line);
       }
     }
   }
 }