⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 use.txt

📁 How to get the java home dir.
💻 TXT
字号:
Includes classes to let  you copy, append (concatenate),
download and upload files from within a Java program.  Also
contains a command-line utility to download files.

Fully commented Java source is provided.  It is now comes in
four parts, MiniFileTransfer, FileTransfer and
MaxiFileTransfer, Download depending on how much
functionality you require.  Now supports copying members in
local jar files.

You use it in your own programs, typically something like this:

// test FileTranser.append
import com.mindprod.filetransfer.FileTransfer;
import java.io.File;
public class Concat
   {
   /**
    * test harness to concatenate c onto the end of b, leaving the result in a.
    *
    * @param args not used
    */
   public static void main ( String[] args )
      {
      File a = new File ("C:/temp/temp.txt");  // does not exist yet
      File b = new File ("E:/mindprod/feedback/peaceincorrect.html");
      File c = new File ("E:/mindprod/jgloss/j.html");

      FileTransfer ft = new FileTransfer ( 50000 /* buffsize */ );
      // source, target
      ft.append( b, a );
      ft.append( c, a );
      }
   }


Command line use:

java -jar download.jar http://x.com/anyfile.html  C:\temp\anyfile.txt

Usually you embed these classes in your own program rather
than using them standalone.

See also the simpler hunkio package.

Version History

1.6 has a conforming package name.

1.7 adds a closeTarget parameter to some methods,
now allowing you to leaving the OutputStream open for
further output.

1.8 adds a command line download utility.

2.0 adds a pad and icon.

2.1 2007-08-04
               convert to JDK 1.5,
               add timeout support
               add sleep to avoid hogging CPU on stall.
               add support for preferred MIME types on download.

2.2 2007-08-24
               use new http Read methods for proper handling of multibyte encoded streams.

2.3 2007-09-26 add timeout.

2.4 2008-07-05 add append method.

2.5 2008-08-10 add setConnectTimeout and setReadTimeout methods


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -