@Test(expected = IOException.class) public void testGetBase64KeystoreNoSuchFile() throws IOException { ConfigurationServerImpl.getBase64Keystore("notexisting" + System.currentTimeMillis()); }
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; }