You must use the stream enabled to transmit real-time files. Here, fileUploadStream is used as an example.
The value of streamName must be the same as that of Stream Name configured in Step 1: Creating a DIS Stream.
//Configure the stream name. String streamName = "fileUploadStream";
Enter the absolute path of the file to be uploaded.
//Specify the path of the file to be uploaded. putFilesRequest.setFilePath("xxxx");
Set the file name to be uploaded. If the file name contains the backslash (\), use the escape character to escape the backslash.
//Specify the file name for storing the uploaded file. putFilesRequest.setFileName("xxxx");
Right-click the program and choosefrom the shortcut menu. If the program is run successfully, you can view the information similar to the following on the console:
17:47:09.103 [main] INFO com.bigdata.dis.sdk.DISConfig - get from classLoader 17:47:10.275 [pool-2-thread-1] INFO com.bigdata.dis.sdk.util.config.ConfigurationUtils - get from classLoader 17:47:10.291 [pool-2-thread-1] INFO com.bigdata.dis.sdk.util.config.ConfigurationUtils - propertyMapFromFile size : 2 17:47:20.012 [pool-2-thread-1] INFO com.bigdata.dis.sdk.demo.FileProducerAsyncDemo - Upload file to DIS successful!