1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| private ArrayList<String> SearchAuthority(Object selectedItem) {
BufferedReader reader = null;
ArrayList<String> list = new ArrayList<String>();
try {
File fs = new File("C:\\Documents and Settings\\adamre\\My Documents\\NetBeansProjects\\EFormMockUp\\src\\eu\\europa\\ec\\eforms\\informationexchange\\v0\\gui\\InformationExchangeACKFormRequestedAuthority.properties");
reader = new BufferedReader(new InputStreamReader(new FileInputStream(fs), "UTF8"));
String line;
int i = 0;
while ((line = reader.readLine()) != null) {
if (line.substring(0, 2).equals(selectedItem.toString())) {
String essai = new String(line.substring(3).getBytes(), "UTF8");
byte[] essai2 = line.substring(3).getBytes("UTF-8");
System.out.println(essai2);
list.add(essai);
System.out.println("TROUVE");
}
i++;
}
} catch (FileNotFoundException ex) {
Logger.getLogger(InformationExchangeACKForm.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(InformationExchangeACKForm.class.getName()).log(Level.SEVERE, null, ex);
} finally {
try {
reader.close();
} catch (IOException ex) {
Logger.getLogger(InformationExchangeACKForm.class.getName()).log(Level.SEVERE, null, ex);
}
}
return list;
} |
Partager