public IrodsFile asFile() throws IrodsException {
        if (exists()) {
            if (irodsFile.isFile()) {
                return (this instanceof JargonFile) ? (IrodsFile) this : new JargonFile(conn, irodsFile);
            } else {
                throw new IrodsException("irods object already exists and is not a file: " + getFullPath());
            }
        } else {
            return new JargonFile(conn, irodsFile);
        }
    }