List of usage examples for org.apache.commons.io Charsets toCharset
public static Charset toCharset(String charset)
From source file:org.apache.sling.discovery.etcd.EtcdDiscoveryService.java
@Nullable private char[] readPwd(@Nonnull String filePath) { if (!isEmpty(filePath)) { InputStream fis = null;//from w ww . jav a2 s .c o m try { fis = new FileInputStream(checkFile(new File(filePath))); return IOUtils.toString(fis, Charsets.toCharset(UTF8)).trim().toCharArray(); } catch (FileNotFoundException e) { throw wrap(e); } catch (IOException e) { throw wrap(e); } finally { IOUtils.closeQuietly(fis); } } return null; }