|
7 | 7 | import java.io.InputStream; |
8 | 8 | import java.io.OutputStream; |
9 | 9 | import java.io.PrintWriter; |
10 | | - |
| 10 | +import java.net.URLEncoder; |
11 | 11 | import java.util.Date; |
12 | 12 | import java.util.HashMap; |
13 | 13 | import java.util.ArrayList; |
@@ -36,8 +36,8 @@ public class RequestResourceServlet extends HttpServlet |
36 | 36 | { |
37 | 37 | private static final long serialVersionUID = 1L; |
38 | 38 | private Config config = JsonConfig.getInstance(); |
39 | | - final static Logger logger = LogManager.getLogger(OAuthRequestResource.class); |
40 | | - |
| 39 | + final static Logger logger = LogManager.getLogger(OAuthRequestResource.class); |
| 40 | + |
41 | 41 | private String htmlString = "<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css\" integrity=\"sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7\" crossorigin=\"anonymous\">" |
42 | 42 | + "<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css\" integrity=\"sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r\" crossorigin=\"anonymous\">" |
43 | 43 | + "<script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js\" integrity=\"sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS\" crossorigin=\"anonymous\"></script>" |
@@ -208,11 +208,11 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) |
208 | 208 | System.out.println(getInvoiceAttachment.get(0).getFileName() + " --- " +getInvoiceAttachment.get(0).getMimeType()); |
209 | 209 |
|
210 | 210 | File f = new File("./"); |
211 | | - String fileName1 = "filename.jpg"; |
| 211 | + String fileName1 = getInvoiceAttachment.get(0).getFileName(); |
212 | 212 | String dirPath = f.getCanonicalPath(); |
213 | 213 | String saveFilePath = dirPath + File.separator + fileName1; |
214 | | - |
215 | | - InputStream in = client.getAttachmentContent("Invoices", newInvoice.get(0).getInvoiceID(),getInvoiceAttachment.get(0).getFileName(),getInvoiceAttachment.get(0).getMimeType()); |
| 214 | + |
| 215 | + InputStream in = client.getAttachmentContentById("Invoices",newInvoice.get(0).getInvoiceID(),getInvoiceAttachment.get(0).getAttachmentID(),getInvoiceAttachment.get(0).getMimeType()); |
216 | 216 |
|
217 | 217 | OutputStream out = new FileOutputStream(saveFilePath); |
218 | 218 |
|
|
0 commit comments