Click here to Skip to main content
15,921,694 members
Home / Discussions / Java
   

Java

 
GeneralRe: Comparing Strings Reverse if-conditional Pin
johtnkucz1-Feb-12 12:26
johtnkucz1-Feb-12 12:26 
GeneralRe: Comparing Strings Reverse if-conditional Pin
Richard MacCutchan1-Feb-12 22:19
mveRichard MacCutchan1-Feb-12 22:19 
GeneralRe: Comparing Strings Reverse if-conditional Pin
johtnkucz3-Feb-12 4:08
johtnkucz3-Feb-12 4:08 
GeneralRe: Comparing Strings Reverse if-conditional Pin
Richard MacCutchan3-Feb-12 4:35
mveRichard MacCutchan3-Feb-12 4:35 
AnswerRe: Comparing Strings Reverse if-conditional Pin
Dinu_613-Feb-12 22:24
Dinu_613-Feb-12 22:24 
Questionhow to get a value in to JS file from java servlet Pin
swapnil661-Feb-12 7:14
swapnil661-Feb-12 7:14 
AnswerRe: how to get a value in to JS file from java servlet Pin
chakki2921-Feb-12 20:57
chakki2921-Feb-12 20:57 
QuestionHow to displaly progress bar for downloading attachment Pin
R_K1-Feb-12 4:05
R_K1-Feb-12 4:05 
I display the progress bar for downloading attachments and it works fine … but when I am downloading some attachments I get the exception message:

Exception in thread "main" com.sun.mail.util.DecodingException: BASE64Decoder: Error in encoded stream: needed 4 valid base64 characters but only got 1 before EOF, the 10 most recent characters were: "Q3w5ilxj2P"

I found the explanation:

Certain IMAP servers do not implement the IMAP Partial FETCH functionality properly. This problem typically manifests as corrupt email attachments when downloading large messages from the IMAP server. To workaround this server bug, set the "mail.imap.partialfetch" property to false. You'll have to set this property in the Properties object that you provide to your Session.
http://java.sun.com/products/javamail/NOTES113.txt

So I turned off partial fetch:
Java
Properties props = System.getProperties();
props.setProperty("mail.store.protocol", "imaps");
props.setProperty("mail.imaps.partialfetch", "false");
Session session = Session.getDefaultInstance(props, null);
Store store = session.getStore("imaps");
store.connect("imap.gmail.com", "<username>","<password>");


this solved the problem ….however the method getInputStream() from the Part class blocks the thread until the attachment is completely downloaded and it is impossible to get the information about the number of bytes which have been already downloaded from mailbox. Without this information it is impossible to display the progress bar. So is there a way to obtain this information and display the progress bar?
AnswerRe: How to displaly progress bar for downloading attachment Pin
Nagy Vilmos1-Feb-12 6:00
professionalNagy Vilmos1-Feb-12 6:00 
GeneralRe: How to displaly progress bar for downloading attachment Pin
R_K2-Feb-12 1:54
R_K2-Feb-12 1:54 
GeneralRe: How to displaly progress bar for downloading attachment Pin
TorstenH.2-Feb-12 2:42
TorstenH.2-Feb-12 2:42 
GeneralRe: How to displaly progress bar for downloading attachment Pin
R_K6-Feb-12 2:50
R_K6-Feb-12 2:50 
QuestionTWAIN/WIA API for java integration with scanner Pin
graeme.m30-Jan-12 6:44
graeme.m30-Jan-12 6:44 
AnswerRe: TWAIN/WIA API for java integration with scanner Pin
Richard MacCutchan30-Jan-12 8:55
mveRichard MacCutchan30-Jan-12 8:55 
GeneralRe: TWAIN/WIA API for java integration with scanner Pin
graeme.m30-Jan-12 22:02
graeme.m30-Jan-12 22:02 
GeneralRe: TWAIN/WIA API for java integration with scanner Pin
Richard MacCutchan30-Jan-12 23:28
mveRichard MacCutchan30-Jan-12 23:28 
GeneralRe: TWAIN/WIA API for java integration with scanner Pin
graeme.m31-Jan-12 0:40
graeme.m31-Jan-12 0:40 
AnswerRe: TWAIN/WIA API for java integration with scanner Pin
gebri31-Jan-12 2:54
gebri31-Jan-12 2:54 
GeneralRe: TWAIN/WIA API for java integration with scanner Pin
graeme.m31-Jan-12 3:30
graeme.m31-Jan-12 3:30 
GeneralRe: TWAIN/WIA API for java integration with scanner Pin
gebri31-Jan-12 3:48
gebri31-Jan-12 3:48 
GeneralRe: TWAIN/WIA API for java integration with scanner Pin
graeme.m31-Jan-12 4:25
graeme.m31-Jan-12 4:25 
Questionjpanel to itext pdf.....its damm urgent Pin
bijalvadher28-Jan-12 19:00
bijalvadher28-Jan-12 19:00 
AnswerRe: jpanel to itext pdf.....its damm urgent Pin
Richard MacCutchan28-Jan-12 21:38
mveRichard MacCutchan28-Jan-12 21:38 
GeneralRe: jpanel to itext pdf.....its damm urgent Pin
bijalvadher28-Jan-12 22:19
bijalvadher28-Jan-12 22:19 
GeneralRe: jpanel to itext pdf.....its damm urgent Pin
Richard MacCutchan28-Jan-12 22:24
mveRichard MacCutchan28-Jan-12 22:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.