Soumettre la recherche
Mettre en ligne
Test
•
Télécharger en tant que TXT, PDF
•
0 j'aime
•
514 vues
F
fshimao
Suivre
Technologie
Formation
Signaler
Partager
Signaler
Partager
1 sur 14
Télécharger maintenant
Recommandé
Easy Button
Easy Button
Adam Dale
Jason parsing
Jason parsing
parallelminder
Android TDD
Android TDD
Godfrey Nolan
Agile Android
Agile Android
Godfrey Nolan
package org dev
package org dev
jaya lakshmi
Android Design Patterns
Android Design Patterns
Godfrey Nolan
Hidden rocks in Oracle ADF
Hidden rocks in Oracle ADF
Euegene Fedorenko
meet.js - QooXDoo
meet.js - QooXDoo
Radek Benkel
Recommandé
Easy Button
Easy Button
Adam Dale
Jason parsing
Jason parsing
parallelminder
Android TDD
Android TDD
Godfrey Nolan
Agile Android
Agile Android
Godfrey Nolan
package org dev
package org dev
jaya lakshmi
Android Design Patterns
Android Design Patterns
Godfrey Nolan
Hidden rocks in Oracle ADF
Hidden rocks in Oracle ADF
Euegene Fedorenko
meet.js - QooXDoo
meet.js - QooXDoo
Radek Benkel
COScheduler In Depth
COScheduler In Depth
WO Community
Tests unitaires mock_kesako_20130516
Tests unitaires mock_kesako_20130516
SOAT
Testing My Patience
Testing My Patience
Adam Lowry
Deploying Straight to Production
Deploying Straight to Production
Mark Baker
To Err Is Human
To Err Is Human
Alex Liu
Devoxx 2012 hibernate envers
Devoxx 2012 hibernate envers
Romain Linsolas
How to build an AOP framework in ActionScript
How to build an AOP framework in ActionScript
Christophe Herreman
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
Niraj Bharambe
MaintainStaffTable
MaintainStaffTable
William Rutherford
code for quiz in my sql
code for quiz in my sql
JOYITAKUNDU1
A Test of Strength
A Test of Strength
Chris Oldwood
Testing Java Code Effectively
Testing Java Code Effectively
Andres Almiray
Rx-Java - Como compor sua aplicacao com Observables
Rx-Java - Como compor sua aplicacao com Observables
lokimad
Nativescript angular
Nativescript angular
Christoffer Noring
Understanding JavaScript Testing
Understanding JavaScript Testing
Kissy Team
Testing, Performance Analysis, and jQuery 1.4
Testing, Performance Analysis, and jQuery 1.4
jeresig
Unit testing en iOS @ MobileCon Galicia
Unit testing en iOS @ MobileCon Galicia
Robot Media
Registro de venta
Registro de venta
lupe ga
Paris js extensions
Paris js extensions
erwanl
import java.awt.event.ActionEvent; import java.awt.event.ActionLis.pdf
import java.awt.event.ActionEvent; import java.awt.event.ActionLis.pdf
anupambedcovers
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
sudhirchourasia86
JJUG CCC 2011 Spring
JJUG CCC 2011 Spring
Kiyotaka Oku
Contenu connexe
Tendances
COScheduler In Depth
COScheduler In Depth
WO Community
Tests unitaires mock_kesako_20130516
Tests unitaires mock_kesako_20130516
SOAT
Testing My Patience
Testing My Patience
Adam Lowry
Deploying Straight to Production
Deploying Straight to Production
Mark Baker
To Err Is Human
To Err Is Human
Alex Liu
Devoxx 2012 hibernate envers
Devoxx 2012 hibernate envers
Romain Linsolas
How to build an AOP framework in ActionScript
How to build an AOP framework in ActionScript
Christophe Herreman
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
Niraj Bharambe
MaintainStaffTable
MaintainStaffTable
William Rutherford
code for quiz in my sql
code for quiz in my sql
JOYITAKUNDU1
A Test of Strength
A Test of Strength
Chris Oldwood
Testing Java Code Effectively
Testing Java Code Effectively
Andres Almiray
Rx-Java - Como compor sua aplicacao com Observables
Rx-Java - Como compor sua aplicacao com Observables
lokimad
Nativescript angular
Nativescript angular
Christoffer Noring
Understanding JavaScript Testing
Understanding JavaScript Testing
Kissy Team
Testing, Performance Analysis, and jQuery 1.4
Testing, Performance Analysis, and jQuery 1.4
jeresig
Unit testing en iOS @ MobileCon Galicia
Unit testing en iOS @ MobileCon Galicia
Robot Media
Registro de venta
Registro de venta
lupe ga
Tendances
(18)
COScheduler In Depth
COScheduler In Depth
Tests unitaires mock_kesako_20130516
Tests unitaires mock_kesako_20130516
Testing My Patience
Testing My Patience
Deploying Straight to Production
Deploying Straight to Production
To Err Is Human
To Err Is Human
Devoxx 2012 hibernate envers
Devoxx 2012 hibernate envers
How to build an AOP framework in ActionScript
How to build an AOP framework in ActionScript
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
MaintainStaffTable
MaintainStaffTable
code for quiz in my sql
code for quiz in my sql
A Test of Strength
A Test of Strength
Testing Java Code Effectively
Testing Java Code Effectively
Rx-Java - Como compor sua aplicacao com Observables
Rx-Java - Como compor sua aplicacao com Observables
Nativescript angular
Nativescript angular
Understanding JavaScript Testing
Understanding JavaScript Testing
Testing, Performance Analysis, and jQuery 1.4
Testing, Performance Analysis, and jQuery 1.4
Unit testing en iOS @ MobileCon Galicia
Unit testing en iOS @ MobileCon Galicia
Registro de venta
Registro de venta
Similaire à Test
Paris js extensions
Paris js extensions
erwanl
import java.awt.event.ActionEvent; import java.awt.event.ActionLis.pdf
import java.awt.event.ActionEvent; import java.awt.event.ActionLis.pdf
anupambedcovers
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
sudhirchourasia86
JJUG CCC 2011 Spring
JJUG CCC 2011 Spring
Kiyotaka Oku
DAOFactory.javaDAOFactory.javapublicclassDAOFactory{ this .docx
DAOFactory.javaDAOFactory.javapublicclassDAOFactory{ this .docx
theodorelove43763
Griffon @ Svwjug
Griffon @ Svwjug
Andres Almiray
Package org dev
Package org dev
jaya lakshmi
Incremental Type Safety in React Apollo
Incremental Type Safety in React Apollo
Evans Hauser
Mastering Java Bytecode With ASM - 33rd degree, 2012
Mastering Java Bytecode With ASM - 33rd degree, 2012
Anton Arhipov
Beautiful java script
Beautiful java script
Ürgo Ringo
Google guava
Google guava
Thomas Ferris Nicolaisen
VISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLE
Darwin Durand
Manual tecnic sergi_subirats
Manual tecnic sergi_subirats
Sergi Subirats Cugat
Nevermore Unit Testing
Nevermore Unit Testing
Ihsan Fauzi Rahman
Web CrawlersrcedusmulylecrawlerController.javaWeb Crawler.docx
Web CrawlersrcedusmulylecrawlerController.javaWeb Crawler.docx
celenarouzie
Android Studio Assignment HelpCan someone who is familiar with And.pdf
Android Studio Assignment HelpCan someone who is familiar with And.pdf
feelinggift
Greach, GroovyFx Workshop
Greach, GroovyFx Workshop
Dierk König
Vaadin7
Vaadin7
Joonas Lehtinen
Deep dive into Oracle ADF
Deep dive into Oracle ADF
Euegene Fedorenko
Tools and Projects Dec 2018 Edition
Tools and Projects Dec 2018 Edition
Jesus Manuel Olivas
Similaire à Test
(20)
Paris js extensions
Paris js extensions
import java.awt.event.ActionEvent; import java.awt.event.ActionLis.pdf
import java.awt.event.ActionEvent; import java.awt.event.ActionLis.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
JJUG CCC 2011 Spring
JJUG CCC 2011 Spring
DAOFactory.javaDAOFactory.javapublicclassDAOFactory{ this .docx
DAOFactory.javaDAOFactory.javapublicclassDAOFactory{ this .docx
Griffon @ Svwjug
Griffon @ Svwjug
Package org dev
Package org dev
Incremental Type Safety in React Apollo
Incremental Type Safety in React Apollo
Mastering Java Bytecode With ASM - 33rd degree, 2012
Mastering Java Bytecode With ASM - 33rd degree, 2012
Beautiful java script
Beautiful java script
Google guava
Google guava
VISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLE
Manual tecnic sergi_subirats
Manual tecnic sergi_subirats
Nevermore Unit Testing
Nevermore Unit Testing
Web CrawlersrcedusmulylecrawlerController.javaWeb Crawler.docx
Web CrawlersrcedusmulylecrawlerController.javaWeb Crawler.docx
Android Studio Assignment HelpCan someone who is familiar with And.pdf
Android Studio Assignment HelpCan someone who is familiar with And.pdf
Greach, GroovyFx Workshop
Greach, GroovyFx Workshop
Vaadin7
Vaadin7
Deep dive into Oracle ADF
Deep dive into Oracle ADF
Tools and Projects Dec 2018 Edition
Tools and Projects Dec 2018 Edition
Dernier
Evaluating the top large language models.pdf
Evaluating the top large language models.pdf
ChristopherTHyatt
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Gabriella Davis
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
naman860154
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
apidays
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Product Anonymous
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
wesley chun
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
The Digital Insurer
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
naman860154
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Delhi Call girls
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
🐬 The future of MySQL is Postgres 🐘
🐬 The future of MySQL is Postgres 🐘
RTylerCroy
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Igalia
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Principled Technologies
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Neo4j
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Martijn de Jong
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Miguel Araújo
Dernier
(20)
Evaluating the top large language models.pdf
Evaluating the top large language models.pdf
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
🐬 The future of MySQL is Postgres 🐘
🐬 The future of MySQL is Postgres 🐘
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Test
1.
package com.gddst.test; import java.io.File; import
java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStream; import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import sun.misc.BASE64Decoder; import com.gddst.util.DateTime; import com.gddst.util.GuidUtil; import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.WebResource; import com.sun.jersey.core.util.MultivaluedMapImpl; import com.sun.jersey.multipart.FormDataMultiPart; public class Test { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Test t = new Test(); /*Map m = new HashMap(); m.put("name", "LQX"); m.put("age", 23); m.put("sex", true); Object s[] = m.keySet().toArray(); for(int i = 0; i < m.size(); i++) { System.out.println(s[i]); System.out.println(m.get(s[i])); }*/ try { //t.test(); //ä¸Šä¼ t.upload2(); //上载 //t.download2(); //åŠ éŠ¤ //t.delete2(); //t.deleteAll2(); //æ ¹æŠ®åŠ³éŠ®åŠæŠ¥è¯¢ //t.findDataPic(); //æ ¹æŠ®å±ŠæŠ§æŠ¥è¯¢ //t.findPicFileInfo();
2.
//æ ¹æŠ®å±ŠæŠ§æŠ¥è¯¢çŠ§çŠŠ //t.findPhotosBase64(); //t.showFile(); //t.download(); //t.deleteFileInfo(); /*String url
= "http://172.16.1.61:8090/gisApp/services/loadXMLService/login"; Client client = Client.create(); URI u = new URI(url); WebResource resource = client.resource(u); String jsonStr = resource.queryParam("userName", "gddst").post(String.class); //String doc = resource.post(String.class); System.out.println(jsonStr);*/ /*String value = MD5.getInstance().getMD5ofStr("89225300"); System.out.println(value); System.out.println("21232F297A57A5A743894A0E4A801FC3");*/ } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void test(){ Client client = Client.create(); URI u; try { u = new URI("http://172.16.1.61:8090/gisApp/services/configService/findSysList6"); //u = new URI("http://172.16.1.61:8080/fileService/rest/fileKuManage/findSysList6"); System.out.println(u); WebResource resource = client.resource(u); List<String> params = new ArrayList<String>(); params.add("SDE.GS_VALVE_ZY"); JSONArray json = JSONArray.fromObject(params); //org.codehaus.jettison.json.JSONArray jsonArray = resource.entity(json, MediaType.APPLICATION_JSON_TYPE).post(org.codehaus.jettison.json.JSONArray.class ); org.codehaus.jettison.json.JSONArray jsonArray = resource.post(org.codehaus.jettison.json.JSONArray.class); System.out.println("把劊㊊"); System.out.println(jsonArray.toString()); } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); System.out.println("失败㊊"); } } public void upload() throws FileNotFoundException{ String url = "http://172.16.1.61:8080/fileService/rest/"; Client client = Client.create(); URI u; try { u = new URI(url+"fileKuManage/upLoadFile");
3.
System.out.println(u); WebResource resource =
client.resource(u); /*"{"+ "'åŠ¯ä¸Šç¼Šç Š': '',"+ "'劳銮劊容': '',"+ "'空銴佊置': '',"+ "'工稊': {'工稊缊劷': '', '工稊劊称': '', '设抽': [{'设抽缊劷': '', '设抽劊称': '', 'GID': ''}]},"+ "'上务': {'上务类劊': '', '设抽': [{'设抽缊劷': '', '设抽劊称': '', 'GID': ''}]},"+ "'设抽': {'设抽缊劷': '', '设抽劊称': '', 'GID': ''}"+ "}";*/ //File f = new File("D:QQ抪劾20120709134241.png"); //File f = new File("D:劊抰抮溊銊犨报表模抿.mht"); File f = new File("D:龊泊把抰iPhone4弊劊把劊2011- 1-27_1.pdf"); AttachmentVO attachmentVO = new AttachmentVO(); attachmentVO.setPfiSize(Double.valueOf(f.length())); attachmentVO.setPfiName(f.getName()); attachmentVO.setPfiType("NORMAL");//类劊(NODE,FIN,RED,POINT,CARD,MEDIO,NORMAL) åŠŠåŠ«ä»£è¡¨èŠŠçŠ¹å¤§æ ·åŠ¾ï¼Šç«£å·¥åŠ¾ï¼Šçº ¢çº¿è§ŠåŠŠåŠ¾ï¼ŠçŠ¹ä¹Šè®°ï¼ŠåŠ¡çŠŠåŠ¾ï¼Šå¤ŠåªŠä½Šï¼Šä¸ŠèŠ¬æŠŠæ¡£ attachmentVO.setMoiNum(GuidUtil.getGuid()); attachmentVO.setTopMoiNum(GuidUtil.getGuid()); /*attachmentVO.setMoiNum("123456"); attachmentVO.setMoiContent("夊媊佊"); attachmentVO.setMoiPosition("POINT(42067.56000000 29471.64300000)");*/ attachmentVO.setUploadUName("A劊犊"); /** * 设抽銊件 */ /*FacilityVO facilityVO = new FacilityVO(); facilityVO.setGid("1001735952"); facilityVO.setModiNum("F406432"); facilityVO.setModiName("銸銊"); attachmentVO.setFacilityVO(facilityVO);*/ /** * 工稊銊件 */ ProjectVO projectVO = new ProjectVO(); projectVO.setMopiNum("G"+DateTime.getDateToString(DateTime.getSysDate2DateTime() ,"yyyyMMddHHmmss")+Math.random()*100); projectVO.setMopiName("管罊抹管工稊"); /** * 工稊銢劊犊设抽*努覊上个銢犊空銴抰抮 */ /*List<FacilityVO> list = new ArrayList<FacilityVO>(); FacilityVO facilityVO = new FacilityVO(); facilityVO.setGid("1001735952"); facilityVO.setModiNum("F406432"); facilityVO.setModiName("銸銊"); list.add(facilityVO);
4.
projectVO.setList(list);*/ attachmentVO.setProjectVO(projectVO); /*BusinessVO businessVO =
new BusinessVO(); businessVO.setMobiType("ç»´ä¿®");*/ /** * 维修銢劊犊设抽*努覊上个銢犊空銴抰抮 */ /*List<FacilityVO> list = new ArrayList<FacilityVO>(); FacilityVO facilityVO = new FacilityVO(); facilityVO.setGid("1001735952"); facilityVO.setModiNum("F406432"); facilityVO.setModiName("銸銊"); list.add(facilityVO); businessVO.setList(list); attachmentVO.setBusinessVO(businessVO);*/ JSONObject json = JSONObject.fromObject(attachmentVO); System.out.println(json.toString()); InputStream in = null; try { // 上次读上个åŠèŠŠ in = new FileInputStream(f); FormDataMultiPart p = new FormDataMultiPart(); p.field("file", in, MediaType.MULTIPART_FORM_DATA_TYPE); p.field("json", json.toString(), MediaType.TEXT_PLAIN_TYPE); String result = resource.entity(p, MediaType.MULTIPART_FORM_DATA_TYPE).post(String.class); System.out.println(result); in.close(); } catch (Exception e) { e.printStackTrace(); System.out.println("ä¸Šä¼ å¤±è´¥ï¼Š"); } } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void upload2() throws FileNotFoundException{ String url = "http://172.16.0.77:8091/fileService/rest/"; Client client = Client.create(); URI u; try { u = new URI(url+"fileKuManage/upLoadFileSimple"); System.out.println(u); WebResource resource = client.resource(u); /*"{"+ "'åŠ¯ä¸Šç¼Šç Š': '',"+ "'劳銮劊容': '',"+ "'空銴佊置': '',"+ "'工稊': {'工稊缊劷': '', '工稊劊称': '', '设抽': [{'设抽缊劷': '', '设抽劊称': '', 'GID': ''}]},"+ "'上务': {'上务类劊': '', '设抽': [{'设抽缊劷':
5.
'', '设施喖称': '',
'GID': ''}]},"+ "'设施': {'设施编喷': '', '设施喖称': '', 'GID': ''}"+ "}";*/ //File f = new File("D:é¾–æ³–é¡¹ç–®ç®¡ç––æ––æ¡£å– ±ç–¨æ––档使疨_Dojo_Mobile_为_iOS_斺薽绖端弖喖_Native- like_Web_庖疨.pdf"); //File f = new File("D:é¾–æ³–é¡¹ç–®ç®¡ç––æ––æ¡£å– ±ç–¨æ––æ¡£bså––å–°æ––ä½–æ––å––.pdf"); File f = new File("E:é¾–æ³–æ––æ–°iPhone4å¼–å––æ––å––2011- 1-27_1.pdf"); AttachmentVO attachmentVO = new AttachmentVO(); attachmentVO.setPfiSize(Double.valueOf(f.length())); attachmentVO.setPfiName(f.getName()); attachmentVO.setPfiType("NORMAL");//类喖(NODE,FIN,RED,POINT,CARD,MEDIO,NORMAL) å––å–«ä»£è¡¨è––ç–¹å¤§æ ·å–¾ï¼–ç«£å·¥å–¾ï¼–çº ¢çº¿è§–喖喾6疹乖记6喡疖喾6外媖佖6世薬斖档 attachmentVO.setMoiNum("123456789"); //attachmentVO.setTopMoiNum(GuidUtil.getGuid()); /*attachmentVO.setMoiNum("123456"); attachmentVO.setMoiContent("外媖佖"); attachmentVO.setMoiPosition("POINT(42067.56000000 29471.64300000)");*/ attachmentVO.setUploadUName("Aå––ç––"); /** * 设施閖件 */ /*FacilityVO facilityVO = new FacilityVO(); facilityVO.setGid("1001735952"); facilityVO.setModiNum("F406432"); facilityVO.setModiName("閸閖"); attachmentVO.setFacilityVO(facilityVO);*/ /** * 工稖閖件 */ /*ProjectVO projectVO = new ProjectVO(); projectVO.setMopiNum("G"+DateTime.getDateToString(DateTime.getSysDate2DateTime() ,"yyyyMMddHHmmss")+Math.random()*100); projectVO.setMopiName("管罖方管工稖");*/ /** * 工稖関喖疖设施6喪視世个関疖空閴新斮 */ /*List<FacilityVO> list = new ArrayList<FacilityVO>(); FacilityVO facilityVO = new FacilityVO(); facilityVO.setGid("1001735952"); facilityVO.setModiNum("F406432"); facilityVO.setModiName("閸閖"); list.add(facilityVO); projectVO.setList(list);*/ /*attachmentVO.setProjectVO(projectVO);*/ /*BusinessVO businessVO = new BusinessVO(); businessVO.setMobiType("ç»´ä¿®");*/
6.
/** * 维修関喖疖设施6喪視世个関疖空閴新斮 */ /*List<FacilityVO> list
= new ArrayList<FacilityVO>(); FacilityVO facilityVO = new FacilityVO(); facilityVO.setGid("1001735952"); facilityVO.setModiNum("F406432"); facilityVO.setModiName("閸閖"); list.add(facilityVO); businessVO.setList(list); attachmentVO.setBusinessVO(businessVO);*/ JSONObject json = JSONObject.fromObject(attachmentVO); System.out.println(json.toString()); InputStream in = null; try { // 世次读世个å–è–– in = new FileInputStream(f); FormDataMultiPart p = new FormDataMultiPart(); p.field("file", in, MediaType.MULTIPART_FORM_DATA_TYPE); p.field("attachmentVO", json.toString(), MediaType.TEXT_PLAIN_TYPE); String result = resource.entity(p, MediaType.MULTIPART_FORM_DATA_TYPE).post(String.class); System.out.println(result); in.close(); } catch (Exception e) { e.printStackTrace(); System.out.println("ä¸–ä¼ å¤±è´¥ï¼–"); } } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void download() throws FileNotFoundException{ String url = "http://172.16.0.77:8097/fileService/rest/"; Client client = Client.create(); URI u; try { u = new URI(url+"fileKuManage/downloadFile"); System.out.println(u); WebResource resource = client.resource(u); /*"{"+ "'å–¯ä¸–ç¼–ç –': '',"+ "'喳閮喖容': '',"+ "'空閴佖置': '',"+ "'工稖': {'工稖编喷': '', '工稖喖称': '', '设施': [{'设施编喷': '', '设施喖称': '', 'GID': ''}]},"+ "'世喡': {'世喡类喖': '', '设施': [{'设施编喷': '', '设施喖称': '', 'GID': ''}]},"+ "'设施': {'设施编喷': '', '设施喖称': '', 'GID': ''}"+ "}";*/
7.
AttachmentVO attachmentVO =
new AttachmentVO(); attachmentVO.setPfiType("FIN");//类喖(NODE,FIN,RED,POINT,CARD,MEDIO,NORMAL)å–– å–«ä»£è¡¨è––ç–¹å¤§æ ·å–¾ï¼–ç«£å·¥å–¾ï¼–çº ¢çº¿è§–喖喾6疹乖记6喡疖喾6外媖佖6世薬斖档 attachmentVO.setMoiNum("6adec864:1386a601d8d:-8000"); attachmentVO.setMoiContent("竣工喾"); attachmentVO.setPfiName("QQ斪喾20120709134241.png"); //attachmentVO.setMoiPosition("POINT(42067.56000000 29471.64300000)"); attachmentVO.setUploadUName("Aå––ç––"); attachmentVO.setDownloadUName("Bå––ç––"); /** * 设施閖件 */ /*FacilityVO facilityVO = new FacilityVO(); facilityVO.setGid("1001735952"); facilityVO.setModiNum("F406432"); facilityVO.setModiName("閸閖"); attachmentVO.setFacilityVO(facilityVO);*/ /** * 工稖閖件 */ ProjectVO projectVO = new ProjectVO(); projectVO.setMopiNum("G201207091414402.9484473859488047"); projectVO.setMopiName("管罖方管工稖"); /** * 工稖関喖疖设施6喪視世个関疖空閴新斮 */ /*List<FacilityVO> list = new ArrayList<FacilityVO>(); FacilityVO facilityVO = new FacilityVO(); facilityVO.setGid("1001735952"); facilityVO.setModiNum("F406432"); facilityVO.setModiName("閸閖"); list.add(facilityVO); projectVO.setList(list);*/ attachmentVO.setProjectVO(projectVO); /*BusinessVO businessVO = new BusinessVO(); businessVO.setMobiType("ç»´ä¿®");*/ /** * 维修関喖疖设施6喪視世个関疖空閴新斮 */ /*List<FacilityVO> list = new ArrayList<FacilityVO>(); FacilityVO facilityVO = new FacilityVO(); facilityVO.setGid("1001735952"); facilityVO.setModiNum("F406432"); facilityVO.setModiName("閸閖"); list.add(facilityVO); businessVO.setList(list); attachmentVO.setBusinessVO(businessVO);*/ JSONObject json = JSONObject.fromObject(attachmentVO); System.out.println(json.toString()); FormDataMultiPart p = new FormDataMultiPart();
8.
p.field("json", json.toString(), MediaType.TEXT_PLAIN_TYPE); try{ byte[]
b = resource.entity(p, MediaType.MULTIPART_FORM_DATA_TYPE).post(byte[].class); File file = new File("D:管罖方管工稖竣工喾.jpg"); FileOutputStream out = new FileOutputStream(file); out.write(b); out.close(); System.out.println("世载斖喖㖖"); }catch(Exception e){ e.printStackTrace(); System.out.println("世载失败㖖"); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void download2() throws FileNotFoundException{ String url = "http://172.16.1.61:8080/fileService/rest/"; Client client = Client.create(); URI u; try { u = new URI(url+"fileKuManage/downloadFileSimple"); WebResource resource = client.resource(u); try{ MultivaluedMap<String, String> map = new MultivaluedMapImpl(); map.putSingle("fileId", "37"); map.putSingle("downloadUserName", "梖閦峰"); byte[] b = resource.queryParams(map).post(byte[].class); File file = new File("D:xxx.pdf"); FileOutputStream out = new FileOutputStream(file); out.write(b); out.close(); System.out.println("世载斖喖㖖"); }catch(Exception e){ e.printStackTrace(); System.out.println("世载失败㖖"); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void showFile() throws Exception{ String url = "http://172.16.0.77:8097/fileService/rest/"; Client client = Client.create(); URI u; try { u = new URI(url+"fileKuManage/findFileInfo"); System.out.println(u); WebResource resource = client.resource(u); /*"{"+
9.
"'å”¯ä¸”ç¼”ç ”': '',"+ "'唳键唔容':
'',"+ "'空锴佔置': '',"+ "'工稔': {'工稔缔唷': '', '工稔唔称': '', '设攽': [{'设攽缔唷': '', '设攽唔称': '', 'GID': ''}]},"+ "'且唡': {'且唡类唔': '', '设攽': [{'设攽缔唷': '', '设攽唔称': '', 'GID': ''}]},"+ "'设攽': {'设攽缔唷': '', '设攽唔称': '', 'GID': ''}"+ "}";*/ AttachmentVO attachmentVO = new AttachmentVO(); //attachmentVO.setPfiType("CARD");//类唔(NODE,FIN,RED,POINT, CARD,MEDIO,NORMAL)å””å”«ä»£è¡¨è””ç”¹å¤§æ ·å”¾ï¼”ç«£å·¥å”¾ï¼”çº ¢çº¿è§”唔唾4甹乔记4唡甔唾4夔媔佔4且蔬攔档 //attachmentVO.setMoiNum("6adec864:1386a601d8d:-8000"); //attachmentVO.setMoiContent("竣工唾"); //attachmentVO.setPfiName("QQ攪唾20120709134241.png"); //attachmentVO.setMoiPosition("POINT(42067.56000000 29471.64300000)"); //attachmentVO.setUploadUName("A唔甔"); //attachmentVO.setDownloadUName("B唔甔"); /** * 设攽锔件 */ /*FacilityVO facilityVO = new FacilityVO(); facilityVO.setGid("1001735952"); //facilityVO.setModiNum("F406432"); //facilityVO.setModiName("锸锔"); attachmentVO.setFacilityVO(facilityVO);*/ /** * 工稔锔件 */ ProjectVO projectVO = new ProjectVO(); //projectVO.setMopiNum("G201207091414402.9484473859488047"); projectVO.setMopiName("管罔改管工稔"); /** * 工稔锢唔甔设攽4唪覔且个锢甔空锴攰攮 */ /*List<FacilityVO> list = new ArrayList<FacilityVO>(); FacilityVO facilityVO = new FacilityVO(); facilityVO.setGid("1001735952"); facilityVO.setModiNum("F406432"); facilityVO.setModiName("锸锔"); list.add(facilityVO); projectVO.setList(list);*/ attachmentVO.setProjectVO(projectVO); /*BusinessVO businessVO = new BusinessVO(); businessVO.setMobiType("ç»´ä¿®");*/ /** * 维修锢唔甔设攽4唪覔且个锢甔空锴攰攮 */ /*List<FacilityVO> list = new ArrayList<FacilityVO>(); FacilityVO facilityVO = new FacilityVO(); facilityVO.setGid("1001735952"); facilityVO.setModiNum("F406432");
10.
facilityVO.setModiName("锸锔"); list.add(facilityVO); businessVO.setList(list); attachmentVO.setBusinessVO(businessVO);*/ JSONObject json =
JSONObject.fromObject(attachmentVO); System.out.println(json.toString()); FormDataMultiPart p = new FormDataMultiPart(); p.field("json", json.toString(), MediaType.TEXT_PLAIN_TYPE); try{ org.codehaus.jettison.json.JSONArray jsonArray = resource.entity(p, MediaType.MULTIPART_FORM_DATA_TYPE).post(org.codehaus.jettison.json.JSONArray.cl ass); System.out.println(jsonArray.toString()); System.out.println("攥询攔唔㔔"); }catch(Exception e){ e.printStackTrace(); System.out.println("攥询失败㔔"); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void deleteFileInfo() throws Exception{ String url = "http://172.16.0.77:8097/fileService/rest/"; Client client = Client.create(); URI u; try { u = new URI(url+"fileKuManage/deleteFileInfo"); System.out.println(u); WebResource resource = client.resource(u); /*"{"+ "'å”¯ä¸”ç¼”ç ”': '',"+ "'唳键唔容': '',"+ "'空锴佔置': '',"+ "'工稔': {'工稔缔唷': '', '工稔唔称': '', '设攽': [{'设攽缔唷': '', '设攽唔称': '', 'GID': ''}]},"+ "'且唡': {'且唡类唔': '', '设攽': [{'设攽缔唷': '', '设攽唔称': '', 'GID': ''}]},"+ "'设攽': {'设攽缔唷': '', '设攽唔称': '', 'GID': ''}"+ "}";*/ AttachmentVO attachmentVO = new AttachmentVO(); //attachmentVO.setPfiType("FIN");//类唔(NODE,FIN,RED,POINT,C ARD,MEDIO,NORMAL)å””å”«ä»£è¡¨è””ç”¹å¤§æ ·å”¾ï¼”ç«£å·¥å”¾ï¼”çº ¢çº¿è§”唔唾4甹乔记4唡甔唾4夔媔佔4且蔬攔档 //attachmentVO.setMoiNum("6adec864:1386a601d8d:-8000"); //attachmentVO.setMoiContent("竣工唾"); //attachmentVO.setPfiName("QQ攪唾20120709134241.png"); //attachmentVO.setMoiPosition("POINT(42067.56000000 29471.64300000)"); //attachmentVO.setUploadUName("A唔甔");
11.
//attachmentVO.setDownloadUName("B唔甔"); /** * 设攽锔件 */ /*FacilityVO facilityVO
= new FacilityVO(); facilityVO.setGid("1001735952"); //facilityVO.setModiNum("F406432"); //facilityVO.setModiName("锸锔"); attachmentVO.setFacilityVO(facilityVO);*/ /** * 工稔锔件 */ ProjectVO projectVO = new ProjectVO(); //projectVO.setMopiNum("G2012090617281279.200125362912"); projectVO.setMopiName("管罔改管工稔"); /** * 工稔锢唔甔设攽4唪覔且个锢甔空锴攰攮 */ /*List<FacilityVO> list = new ArrayList<FacilityVO>(); FacilityVO facilityVO = new FacilityVO(); facilityVO.setGid("1001735952"); facilityVO.setModiNum("F406432"); facilityVO.setModiName("锸锔"); list.add(facilityVO); projectVO.setList(list);*/ attachmentVO.setProjectVO(projectVO); /*BusinessVO businessVO = new BusinessVO(); businessVO.setMobiType("ç»´ä¿®");*/ /** * 维修锢唔甔设攽4唪覔且个锢甔空锴攰攮 */ /*List<FacilityVO> list = new ArrayList<FacilityVO>(); FacilityVO facilityVO = new FacilityVO(); facilityVO.setGid("1001735952"); facilityVO.setModiNum("F406432"); facilityVO.setModiName("锸锔"); list.add(facilityVO); businessVO.setList(list); attachmentVO.setBusinessVO(businessVO);*/ JSONObject json = JSONObject.fromObject(attachmentVO); System.out.println(json.toString()); FormDataMultiPart p = new FormDataMultiPart(); p.field("json", json.toString(), MediaType.TEXT_PLAIN_TYPE); try{ String message = resource.entity(p, MediaType.MULTIPART_FORM_DATA_TYPE).post(String.class); System.out.println(message); }catch(Exception e){ e.printStackTrace(); System.out.println("å” é”¤å¤±è´¥ã””"); }
12.
} catch (Exception
e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void delete2() throws FileNotFoundException{ String url = "http://172.16.0.51:8090/fileService/rest/"; Client client = Client.create(); URI u; try { u = new URI(url+"fileKuManage/deleteFileSimple"); WebResource resource = client.resource(u); try{ MultivaluedMap<String, String> map = new MultivaluedMapImpl(); map.putSingle("fileId", "73"); String s = resource.queryParams(map).post(String.class); System.out.println(s); System.out.println("å” é”¤æ””å””ã””"); }catch(Exception e){ e.printStackTrace(); System.out.println("å” é”¤å¤±è´¥ã””"); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void deleteAll2() throws FileNotFoundException{ String url = "http://172.16.0.51:8090/fileService/rest/"; Client client = Client.create(); URI u; try { u = new URI(url+"fileKuManage/deleteFileAllSimple"); WebResource resource = client.resource(u); try{ MultivaluedMap<String, String> map = new MultivaluedMapImpl(); map.putSingle("linkNum", "99999"); map.putSingle("type", "1");//0=å”¯ä¸”ç¼”ç ”ï¼” 1=é¡¶çº§å” ³è””缔唷 String s = resource.queryParams(map).post(String.class); System.out.println(s); System.out.println("å” é”¤æ””å””ã””"); }catch(Exception e){ e.printStackTrace(); System.out.println("å” é”¤å¤±è´¥ã””"); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void findPicFileInfo(){ String url = "http://172.16.1.61:8080/fileService/rest/"; Client client = Client.create();
13.
URI u; try { u
= new URI(url+"fileKuManage/findPicFileInfo"); System.out.println(u); WebResource resource = client.resource(u); Map<String, Object> map = new HashMap<String, Object>(); map.put("linkNum", "7a796926:13de3a20fef:-7fd3"); JSONObject json = JSONObject.fromObject(map); FormDataMultiPart p = new FormDataMultiPart(); p.field("json", json.toString(), MediaType.TEXT_PLAIN_TYPE); try{ org.codehaus.jettison.json.JSONArray jsonArray = resource.entity(p, MediaType.MULTIPART_FORM_DATA_TYPE).post(org.codehaus.jettison.json.JSONArray.cl ass); JSONObject jsonObject = JSONObject.fromObject(jsonArray.get(0).toString()); System.out.println(jsonArray.toString()); System.out.println(jsonObject.getString("picFileInfoUrl")); System.out.println("查询柟域㟟"); }catch(Exception e){ e.printStackTrace(); System.out.println("查询失败㟟"); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void findDataPic(){ String url = "http://172.16.1.61:8080/fileService/rest/"; Client client = Client.create(); URI u; try { u = new URI(url+"fileKuManage/findDataPic"); System.out.println(u); WebResource resource = client.resource(u); List<String> list = new ArrayList<String>(); list.add("-49179b5b:13d5e470eba:-7ff9埰基矧矟"); JSONArray array = JSONArray.fromObject(list); FormDataMultiPart p = new FormDataMultiPart(); p.field("list", array.toString(), MediaType.TEXT_PLAIN_TYPE); try{ org.codehaus.jettison.json.JSONArray jsonArray = resource.entity(p, MediaType.MULTIPART_FORM_DATA_TYPE).post(org.codehaus.jettison.json.JSONArray.cl ass); System.out.println(jsonArray.toString()); System.out.println("查询柟域㟟"); }catch(Exception e){ e.printStackTrace(); System.out.println("查询失败㟟");
14.
} } catch (Exception
e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void findPhotosBase64(){ String url = "http://172.16.1.61:8080/fileService/rest/"; Client client = Client.create(); URI u; try { u = new URI(url+"fileKuManage/findPhotosBase64"); System.out.println(u); WebResource resource = client.resource(u); Map<String, Object> map = new HashMap<String, Object>(); map.put("linkNum", "5be490f1:13b87fae513:-7ffd"); JSONObject json = JSONObject.fromObject(map); FormDataMultiPart p = new FormDataMultiPart(); p.field("json", json.toString(), MediaType.TEXT_PLAIN_TYPE); try{ org.codehaus.jettison.json.JSONArray jsonArray = resource.entity(p, MediaType.MULTIPART_FORM_DATA_TYPE).post(org.codehaus.jettison.json.JSONArray.cl ass); JSONObject jsonObject = JSONObject.fromObject(jsonArray.get(0).toString()); System.out.println(jsonArray.toString()); //System.out.println(jsonObject.getString("photoName")); System.out.println(jsonObject.getString("photo")); BASE64Decoder decoder = new BASE64Decoder(); byte[] b = decoder.decodeBuffer(jsonObject.getString("photo")); File file = new File("D:xxx.jpg"); FileOutputStream out = new FileOutputStream(file); out.write(b); out.close(); System.out.println("查询柟域㟟"); }catch(Exception e){ e.printStackTrace(); System.out.println("查询失败㟟"); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
Télécharger maintenant