/** * @param file * @return The byte array * @throws IOException */ public static byte[] readToByteArray(File file) throws IOException { return readToByteArray(new FileInputStream(file)); }
/** * @param file * @return The byte array * @throws IOException */ public static byte[] readToByteArray(File file) throws IOException { return readToByteArray(new FileInputStream(file)); }
/** * Gets the default proxy certificate. * * @return Default my proxy credentials. * @throws org.apache.airavata.gfac.GFacException If an error occurred while retrieving credentials. * @throws org.apache.airavata.common.exception.ApplicationSettingsException */ public SSHCredential getDefaultCredentials() throws GFacException, ApplicationSettingsException, IOException { Properties configurationProperties = ServerSettings.getProperties(); String sshUserName = configurationProperties.getProperty(Constants.SSH_USER_NAME); this.getRequestData().setRequestUser(sshUserName); this.privateKeyFile = configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY); this.publicKeyFile = configurationProperties.getProperty(Constants.SSH_PUBLIC_KEY); this.passPhrase = configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY_PASS); this.getRequestData().setRequestUser(sshUserName); return new SSHCredential(IOUtil.readToByteArray(new File(this.privateKeyFile)), IOUtil.readToByteArray(new File(this.publicKeyFile)), this.passPhrase, requestData.getGatewayId(), sshUserName); }
classBytes = IOUtil.readToByteArray(classFile); classBytes = IOUtil.readToByteArray(classInputStream);