Пример #1
0
 public void fileDownLoading() throws IOException {
   chatUI
       .getChatClient()
       .sendMessage(
           MessageType.C_DOWNLOAD
               + MessageType.DELIMETER
               + UserLoginPanel.userId
               + MessageType.DELIMETER
               + save);
 }
Пример #2
0
 public void fileUploadDialog() throws IOException {
   JFileChooser fileChooser = new JFileChooser("."); // 경로 설정.
   int action = fileChooser.showOpenDialog(this);
   // 열기 버튼 선택시
   if (action == JFileChooser.APPROVE_OPTION) { // 열기 였는지 확인 상수 1
     File selectedFile = fileChooser.getSelectedFile();
     dao = new FileDao(selectedFile.getAbsolutePath());
     chatUI
         .getChatClient()
         .sendMessage(
             MessageType.C_UPLOAD
                 + MessageType.DELIMETER
                 + UserLoginPanel.userId
                 + MessageType.DELIMETER
                 + 1
                 + MessageType.DELIMETER
                 + dao.getFile().getName()
                 + MessageType.DELIMETER
                 + dao.getFileSize());
   }
 }