@Test public void testGetBase64Keystore() throws IOException { final File temp = File.createTempFile("keystore", ""); try { FileUtils.writeStringToFile(temp, Base64.encodeBase64String(TEST.getBytes())); final String keystore = ConfigurationServerImpl.getBase64Keystore(temp.getPath()); Base64.decodeBase64(keystore); } finally { temp.delete(); } }
static String getBase64Keystore(final String keystorePath) throws IOException { final byte[] storeBytes = FileUtils.readFileToByteArray(new File(keystorePath)); if (storeBytes.length > 3000) { throw new IOException("KeyStore is too big for database! Length " + storeBytes.length); } return new String(Base64.encodeBase64(storeBytes)); }
ConfigurationServerImpl extends ManagerBase implements ConfigurationServer { static String getBase64Keystore(final String keystorePath) throws IOException { final byte[] storeBytes = FileUtils.readFileToByteArray(new File(keystorePath)); if (storeBytes.length > 3000) { throw new IOException("KeyStore is too big for database! Length " + storeBytes.length); } return new String(Base64.encodeBase64(storeBytes)); } }
ConfigurationServerImpl extends ManagerBase implements ConfigurationServer { static String getBase64Keystore(final String keystorePath) throws IOException { final byte[] storeBytes = FileUtils.readFileToByteArray(new File(keystorePath)); if (storeBytes.length > 3000) { throw new IOException("KeyStore is too big for database! Length " + storeBytes.length); } return new String(Base64.encodeBase64(storeBytes)); } ConfigurationServerImpl(); }
ConfigurationServerImpl extends ManagerBase implements ConfigurationServer { static String getBase64Keystore(final String keystorePath) throws IOException { final byte[] storeBytes = FileUtils.readFileToByteArray(new File(keystorePath)); if (storeBytes.length > 3000) { throw new IOException("KeyStore is too big for database! Length " + storeBytes.length); } return new String(Base64.encodeBase64(storeBytes)); } ConfigurationServerImpl(); @Override boolean configure(final String name, final Map<String, Object> params); @Override void persistDefaultValues(); @DB void saveUser(); @DB void updateResourceCount(); Map<String, String> getServicesAndProvidersForNetwork(final long networkOfferingId); @Override @DB void updateKeyPairs(); @Override List<ConfigurationVO> getConfigListByScope(final String scope, final Long resourceId); }
ConfigurationServerImpl extends ManagerBase implements ConfigurationServer { static String getBase64Keystore(final String keystorePath) throws IOException { final byte[] storeBytes = FileUtils.readFileToByteArray(new File(keystorePath)); if (storeBytes.length > 3000) { throw new IOException("KeyStore is too big for database! Length " + storeBytes.length); } return new String(Base64.encodeBase64(storeBytes)); } ConfigurationServerImpl(); @Override boolean configure(final String name, final Map<String, Object> params); @Override void persistDefaultValues(); @DB void saveUser(); @DB void updateResourceCount(); Map<String, String> getServicesAndProvidersForNetwork(final long networkOfferingId); @Override @DB void updateKeyPairs(); @Override List<ConfigurationVO> getConfigListByScope(final String scope, final Long resourceId); static final Logger s_logger; }