rath.msnm.ftp
Class VolatileDownloader

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--rath.msnm.ftp.VolatileDownloader
All Implemented Interfaces:
Runnable, VolatileTransfer

public class VolatileDownloader
extends Thread
implements VolatileTransfer

ÆÄÀÏÀ» ¼ö½Å¿äûÀ» Çã¶ôÇßÀ»¶§, ½ÇÁ¦·Î ÆÄÀÏÀ» ´Ù¿î·ÎµåÇϴ Ŭ·¡½ºÀÌ´Ù.

Version:
$Id: VolatileDownloader.java,v 1.1.1.1 2002/03/03 21:32:36 xrath Exp $, since 2001/01/12
Author:
Jang-Ho Hwang, rath@xrath.com

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
 void close()
           
protected  void fireError(Throwable e)
          ÆÄÀÏ Àü¼ÛµµÁß ¿¹±âÄ¡ ¸øÇÑ ¿¹¿Ü°¡ ¹ß»ýÇÏ¿´À»¶§, ºÒ·ÁÁø´Ù.
protected  void fireStart()
           
 String getAuthCookie()
          ½Å¿øÈ®ÀÎÀ» À§ÇØ Àü¼ÛÇÒ ¸ñÀûÀ¸·Î ¼³Á¤µÈ ÀÎÁõÄíÅ°°ªÀ» ¾ò¾î¿Â´Ù.
 int getCommitPercent()
          ½ÇÁ¦·Î ¼Û/¼ö½ÅµÈ ¹ÙÀÌÆ® Å©±â¸¦ ¾ò¾î¿Â´Ù.
 String getCookie()
          ÀÌ ÆÄÀÏÀü¼Û ¼¼¼Ç¿¡ ´ëÇÑ ÄíÅ°°ªÀ» ¾ò¾î¿Â´Ù.
 int getCurrentFileSize()
          ÇöÀç ½ÇÁ¦·Î ¼ö½ÅµÈ byte ¼ö¸¦ ¹ÝȯÇÑ´Ù.
 File getFile()
          ¼ö½ÅµÉ ÆÄÀÏ °´Ã¼¸¦ ¹ÝȯÇÑ´Ù.
 void getFileContent()
           
 String getFilename()
          ¼Û/¼ö½ÅµÇ°í ÀÖ´Â ÆÄÀÏÀÇ À̸§À» ¾ò¾î¿Â´Ù.
 int getFileSize()
          ¹ÞÀ» ÆÄÀÏÀÇ Àüü Å©±â¸¦ ¾ò¾î¿Â´Ù.
 String getHostAddress()
          ¼Û½ÅÃø Host ÁÖ¼Ò¸¦ ¾ò¾î¿Â´Ù.
static VolatileDownloader getInstance(MSNMessenger msn, File toReceive, MimeMessage msg)
          VolatileDownloaderÀÇ ÀνºÅϽº¸¦ »ý¼ºÇÑ´Ù.
 int getPort()
          ¼Û½ÅÃø port ¹øÈ£¸¦ ¾ò¾î¿Â´Ù.
protected  void makeConnection()
          ¼­¹ö¿¡ Á¢¼ÓÇÏ°í ½ºÆ®¸²µéÀ» »ý¼ºÇÑ´Ù.
 void processMessage(String header, String body)
           
 void run()
          Thread main loop ó¸® ºÎºÐÀÌ´Ù.
 void sendMessage(String header)
           
 void sendMessage(String header, String body)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static VolatileDownloader getInstance(MSNMessenger msn,
                                             File toReceive,
                                             MimeMessage msg)
VolatileDownloaderÀÇ ÀνºÅϽº¸¦ »ý¼ºÇÑ´Ù.


getHostAddress

public String getHostAddress()
¼Û½ÅÃø Host ÁÖ¼Ò¸¦ ¾ò¾î¿Â´Ù.


getPort

public int getPort()
¼Û½ÅÃø port ¹øÈ£¸¦ ¾ò¾î¿Â´Ù.


getAuthCookie

public String getAuthCookie()
½Å¿øÈ®ÀÎÀ» À§ÇØ Àü¼ÛÇÒ ¸ñÀûÀ¸·Î ¼³Á¤µÈ ÀÎÁõÄíÅ°°ªÀ» ¾ò¾î¿Â´Ù.


getCookie

public String getCookie()
ÀÌ ÆÄÀÏÀü¼Û ¼¼¼Ç¿¡ ´ëÇÑ ÄíÅ°°ªÀ» ¾ò¾î¿Â´Ù.


getFile

public File getFile()
¼ö½ÅµÉ ÆÄÀÏ °´Ã¼¸¦ ¹ÝȯÇÑ´Ù.


getFilename

public String getFilename()
Description copied from interface: VolatileTransfer
¼Û/¼ö½ÅµÇ°í ÀÖ´Â ÆÄÀÏÀÇ À̸§À» ¾ò¾î¿Â´Ù.

Specified by:
getFilename in interface VolatileTransfer

getCurrentFileSize

public int getCurrentFileSize()
ÇöÀç ½ÇÁ¦·Î ¼ö½ÅµÈ byte ¼ö¸¦ ¹ÝȯÇÑ´Ù.


getCommitPercent

public int getCommitPercent()
Description copied from interface: VolatileTransfer
½ÇÁ¦·Î ¼Û/¼ö½ÅµÈ ¹ÙÀÌÆ® Å©±â¸¦ ¾ò¾î¿Â´Ù.

Specified by:
getCommitPercent in interface VolatileTransfer

getFileSize

public int getFileSize()
¹ÞÀ» ÆÄÀÏÀÇ Àüü Å©±â¸¦ ¾ò¾î¿Â´Ù. ÀÌ ¼öÄ¡´Â ProgressBarµîÀ» ±¸ÇöÇϴµ¥ À¯¿ëÇÑ °ªÀÌ µÇ¾î ÁÙ °ÍÀÌ´Ù. ¸¸¾à -1ÀÌ ¹ÝȯµÈ´Ù¸é, ¾ÆÁ÷ ÆÄÀÏÅ©±â Á¤º¸¸¦ ¾òÁö ¸øÇÑ°ÍÀÌ´Ï, Á¶±Ý ±â´Ù¸° ÈÄ ´Ù½Ã ¼öÇàÇϱ⠹ٶõ´Ù.


run

public final void run()
Thread main loop ó¸® ºÎºÐÀÌ´Ù.

Specified by:
run in interface Runnable
Overrides:
run in class Thread

processMessage

public void processMessage(String header,
                           String body)
                    throws Throwable
Throwable

sendMessage

public void sendMessage(String header)
                 throws IOException
IOException

sendMessage

public void sendMessage(String header,
                        String body)
                 throws IOException
IOException

getFileContent

public void getFileContent()
                    throws IOException
IOException

close

public void close()

fireStart

protected void fireStart()

fireError

protected void fireError(Throwable e)
ÆÄÀÏ Àü¼ÛµµÁß ¿¹±âÄ¡ ¸øÇÑ ¿¹¿Ü°¡ ¹ß»ýÇÏ¿´À»¶§, ºÒ·ÁÁø´Ù. ÀÌ ¸Þ¼Òµå¿¡¼­´Â ¿¹¿Ü À̺¥Æ®¸¦ ¹ß¼ÛÇØÁÙ °ÍÀÌ´Ù.


makeConnection

protected void makeConnection()
                       throws IOException
¼­¹ö¿¡ Á¢¼ÓÇÏ°í ½ºÆ®¸²µéÀ» »ý¼ºÇÑ´Ù.

IOException