Code example for File

Methods: canReadexistsgetCanonicalPath

     * @param file your file 
     * @param mode the POSIX mode to open the file, e.g "r" or "w+" 
     * @throws IOException 
    protected GnuPGData(File file, String mode) throws IOException, GnuPGException {
        if (file == null || !file.exists())
            throw new FileNotFoundException();
        if (!file.canRead())
            throw new IOException("Cannot read: " + file);
        if (!file.canRead())
            throw new IOException("Is a directory: " + file);
        setInternalRepresentation(gpgmeDataNewFromFilename(file.getCanonicalPath(), mode));
     * Use the factory methods from GnuPGContext to create GnuPGData instances. 
     * Generates a new data object containing the given String. 
     * @param str your string