I know that there is Vuze API and jBitTorrent library but I can't use Vuze because of I have server without GUI and jBitTorrent is too old and too buggy. Can you tell me that bittorrent library for Java is good now? I need to download files through torrent file only. Thanks.
It seems you need to run Vuze headless through it's console ui.
When I tried it with the apt-gettable Vuze on Ubuntu, I didn't need to 'grab a few support jars' as the wiki linked above specified - it just ran straight away.
You can use Transmission or µTorrent, or just run Vuze headless. With sending files to Transmission, you need to encode the binary data as base 64, with sending them to µTorrent, you need to use a multipart form via HTTP POST.
Here are their API pages:
https://trac.transmissionbt.com/browser/trunk/extras/rpc-spec.txt
http://www.utorrent.com/community/developers/webapi
Related
Hope you all be fine and doing great.
I am currently working on a Java Web Application. I am getting Streaming video using RTSP URL. This URL is like:
rtsp://---.---.---./6ca714ae28e52f31
I have been able to capture video, diplay/listen it and store it in .mp4 file using FFMPEG with the following command:
fmpeg -i rtsp://username:password#---.---.---.---/6ca714ae28e52f31 -f mov e:/bay.mov (with authentication)
Now, I want to achieve the same in my Java application using ffmped library. I am sure if all this possible through commands then It will also be possible using its library. But unfortunately couldn't get any working useful material regarding this on web.
So, I simply want to ask that:
1. How can I fetch Streams using this RTSP URL in my Java Application with FFMPEG library
2. How can I Manipulate this fetched streaming such as start, stop, end etc.
3. How can I store this streaming in media file in playable form in any specified format.
I have found a FFMPEG's Java Rapper JJMPEG. Now I have two options either to issue FFMPEG command to CMD using Java Application or use JJMPEG library directly. Don't know which one will be better choice.
Thanks for your time and considerations.
I would like to know how to upload a file to Amazon S3 with 'Pause and Resume' support? (Via a web browser).
Are there any sample web applications available? Any programming language / framework is fine.
Thanks in advance.
SOLUTION
I implemented the following app. Github Link.
It is based on the sample app and gem from Condominios.
All credit to https://github.com/cotag/ for a great gem and work.
FEATURES:
- Pause / Resume support ~ 5MB chunks
- Large File Upload
- Progress Bar
- No Java Applet / No Flash
- Registration system via devise
That one is a big one. I have been looking for a clean answer for that for a very long time. I even built somethings but it always comes down to using a medium for your application. I think the best solution I have found is using this. It really is a very simple idea and the great part is it only uses a small amount of flash to use.
S3 Heroku Flash Uploader
Github Source Code
However the down side is your not going to be able to upload anything successfully that is over 512 MB there is some sort of cashing fall out after that point. Loose track or something. I think the only other solution that I can think of is to build a Java Application that would handling the uploading to the server. At least then you have a more stable connection and don't have to worry about the problems with the browser.
You should build it using the multipart upload API. Here's the link for Java:
http://docs.amazonwebservices.com/AmazonS3/2006-03-01/dev/mpListPartsJavaAPI.html
The idea would be to initiate a multi-part upload, start uploading parts (whose size would be based on the client's transfer rate) and whenever the user pauses the upload, stop uploading parts. You won't have byte by byte pause granularity, but I suspect the user would not notice that.
I implemented the following app. Github Link:
https://github.com/interpegasus/condo_example
It is based on the sample app and gem from:
http://cotag.github.com/Condominios/
All credit to https://github.com/cotag/ for a great gem and work.
FEATURES:
Pause / Resume support ~ 5MB chunks
Large File Upload
Progress Bar
No Java Applet / No Flash
Registration system via devise
Evaporate js is a pretty good plugin for this specific task.
Have a look here:
https://github.com/TTLabs/EvaporateJS
You'll need a client something like this: https://github.com/23/resumable.js
And a server that:
Writes the chunks somewhere (locally or to S3)
Uploads the fully-assembled file to S3.
You are not going to be able to do it straight from the browser to S3.
Update: S3 supports CORS now. http://aws.amazon.com/about-aws/whats-new/2012/08/31/amazon-s3-announces-cross-origin-resource-sharing-CORS-support/
Have you tried S3Fox firefox plugin ?
It has both front end and backend implmentation with S3
https://medium.com/#selvakumar.ponnusamy/resumable-file-upload-with-s3-ce039cbc8865
I don't have the code available right now, but I'll describe my situation and post code later on :). Basically, my problem is with uploading image to server via POST (from Java desktop application / client). I found some discussions here on this matter, but it either included using org.apache.commons.httpclient classes, and I have most of the code implemented using URLConnection class, OR with bugs in it. Check this selected answer to see what I followed in as much detail as possible: Using java.net.URLConnection to fire and handle HTTP requests
Anyways, I created php script on my local server that handles form with file upload. I checked it from one static html that was created along with .php. I then checked it without file upload, and it works ok.
It also works ok when I send plain text file. This looks like a problem related to encoding. Maybe some strange character is breaking my transfer?
As I said, I'll include code if necessary later today, but I'm interested in your opinions / experience related to encoding images when sending via POST. Should I do something else, that's not being mentioned in the link above.
QUESTION: do I need to use some kind of encoding to actual data when sending binary file in multipart message via http post?
Sorry for no code right now.
Cheers
As for your question: yes, you need to encode the file.
I would use HttpClient for this as it takes care of all those things for you. No need to reinvent the wheel. See How to upload a file using Java HttpClient library working with PHP for code.
If you are using URLConnection to handle multipart/form-data manually, I guess you you need to add "Content-Transfer-Encoding: binary" to the image part. See W3C's docs.
just looking for a point in the correct direction..
So I've developed a little application on the back end of our websites that allows the girls in our office to send out letter-headed PDF quotations to our potential clients via email.
I've done this using a simple HTML form, the FPDF class, and the php function mail()
It works a treat, but I'd like to take it a step further and create a desktop application so that the girls don't have to go through the login section of the website to access this functionality.
I'm thinking Java?
Would this be a difficult mission someone who has only had web-developing experience?
It would only be the smallest/simplest of applications.
Thanks for any input :)
This is just an advice.
Since you have already developed something that works over web, reuse it.
Convert the PDF converter into a service to upload and retrieve file. This service should return a token_id that can be used later to download the converted files.
Write a Java app using Swing that merely uses this web service. The logic in this application should be (a) browse file from computer, (b) Use web-service upload URL to upload the file and rec/eive appropriate response like upload_token_id and status uploaded/converted/failed, (c) the Java app, should be able to use this token to download the converted file.
You may need to look into this for help related to uploading the file
No it wouldn't be difficult job to mimic your app to java desktop app that can be Java Swing APP. you just need some practice on swing. As you are doing in php that is creating PDF and mailing it. This task can easily be done in java swing by using Java Mail API for emailing and IText for pdf generation.
For reference you can read following links:
http://www.javabeginner.com/java-swing/java-swing-tutorial
http://zetcode.com/tutorials/javaswingtutorial/
http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/
http://www.oracle.com/technetwork/java/javamail/index.html
http://java.sun.com/products/javamail/javadocs/index.html
http://www.javacommerce.com/displaypage.jsp?name=javamail.sql&id=18274
http://viralpatel.net/blogs/2009/04/generate-pdf-file-in-java-using-itext-jar.html
Hope this helps.
I'm trying to find something that will let users upload multiple files to a website. The requirements are that it let them easily select multiple files (preferably with something like check boxes) and that it displays a preview of the images they select.
I'd prefer to only use Javascript or Flash if possible, but Java is also an option (this needs to work on platforms where Silverlight isn't available).
So far all I've been able to find are things that use the native file selector (which doesn't show previews on Windows, and makes it unclear that you can select multiple by holding ctrl).
I'm not sure if the preview requirement is even possible, but it's the most important.
This is a firefox solution:
It uses the FileReader javascript object to load, display and upload images.
http://hacks.mozilla.org/2011/01/how-to-develop-a-html5-image-uploader/
It still doesnt show previews in the FileSelection dialog but at least allows you to preview the images before uploading.
And here is a ready made java applet solution:
http://jumploader.com/doc_overview.html
To upload multiple files I use RichFaces rich:fileUpload component.
Concerning the preview, I've got the similar problem and the best I found after couple of days of googling is following.
Alfresco has the same problem and resolved it with :
An open office which runs in server mode (socket) and all the office documents are sent by alfresco to open office in order to convert them in PDF
Those PDF are converted to .swf viewer thanks to SWFTOOLS
This .swf is integrated in the HTML
For images, it uses ImageMagick to create small version of the file I suppose
Personnaly, I will try to implement it this way :
Converting office documents to PDF thanks to open office in socket mode
Transform the first page of the PDF into a PNG thanks to JPedal library
Diplay that PNG to the end user
For images I would perhaps use ImageMagick too ... but for now, I'm using Seam Image.scaleToFit API
I am assuming 2 things here:
1) Some kind of client/enduser will be doing the file upload
2) You get some kind of say on what the client installs on their computer to help make this happen.
If this is the case, my first suggestion would be:
Give them FTP or SFTP client software to upload files. The php page you make can have a link to Filezilla, along with instructions on how to use it. ftp and sftp are THE protocols to use for transferring files. HTTP is just not designed(well) for it, nor are browsers.
Once the user has the (S)FTP client software installed, you can give them URL's to upload files to that are specific to their user account, and you can have a backend script process and load/move files that they upload. It's pretty easy to create a local temporary directory using a server side script, have the client upload files via ftp, then go back to the web browser and click a button that says "Done uploading, please process my stuff".
The browser can even give back confirmations on everything that gets uploaded/processed.