SVNRepositoryLocation location = null;
SVNRepositoryLocation location;
    public static void main(String[] args) {        /*         * Default values:         */        String url = "http://72.9.228.230:8080/svn/jsvn/trunk";        /*         * Authentication is generally not required for reading operations         */        String name = "anonymous";        String password = "anonymous";        String filePath = "www/usage.html";        /*         * Initializes the library (it must be done before ever using the         * library itself)         */        setupLibrary();        if (args != null) {            /*             * Obtains a repository location URL             */            url = (args.length >= 1) ? args[0] : url;            /*             * Obtains a file path             */            filePath = (args.length >= 2) ? args[1] : filePath;            /*             * Obtains an account name (will be used to authenticate the user to             * the server)             */            name = (args.length >= 3) ? args[2] : name;            /*             * Obtains a password             */            password = (args.length >= 4) ? args[3] : password;        }        SVNRepositoryLocation location = null;        SVNRepository repository = null;        try {            /*             * Parses the URL string and creates an SVNRepositoryLocation which             * represents the repository location - it can be             * any versioned entry inside the repository.             */            location = SVNRepositoryLocation.parseURL(url);            /*             * Creates an instance of SVNRepository to work with the repository.             * All user's requests to the repository are relative to the             * repository location used to create this SVNRepository.             */            repository = SVNRepositoryFactory.create(location);        } catch (SVNException svne) {            /*             * Perhaps a malformed URL is the cause of this exception             */            System.err                    .println("error while creating an SVNRepository for the location '"                            + url + "': " + svne.getMessage());            System.exit(1);        }        /*         * Creates a usre's credentials provider         */        ISVNCredentialsProvider scp = new SVNSimpleCredentialsProvider(name,                password);        /*         * Sets the provider of the user's credentials that will be used to         * authenticate the user to the server (if needed) during operations         * handled by SVNRepository         */        repository.setCredentialsProvider(scp);        /*         * This Map will be used to get the file properties. Each Map key is a         * property name and the value associated with the key is the property         * value.         */        Map fileProperties = new HashMap();        ByteArrayOutputStream baos = new ByteArrayOutputStream();        try {            /*             * Checks up if the specified path really corresponds to a file. If             * doesn't the program exits. SVNNodeKind is that one who says what is             * located at a path in a revision. -1 means the latest revision.             */            SVNNodeKind nodeKind = repository.checkPath(filePath, -1);                        if (nodeKind == SVNNodeKind.NONE) {                System.err.println("There is no entry at '" + url + "'.");                System.exit(1);            } else if (nodeKind == SVNNodeKind.DIR) {                System.err.println("The entry at '" + url                        + "' is a directory while a file was expected.");                System.exit(1);            }            /*             * Gets the contents and properties of the file located at filePath             * in the repository at the latest revision (which is meant by a             * negative revision number).             */            repository.getFile(filePath, -1, fileProperties, baos);        } catch (SVNException svne) {            System.err.println("error while fetching the file contents and properties: " + svne.getMessage());            System.exit(1);        }        /*         * Here the SVNProperty class is used to get the value of the         * svn:mime-type property (if any). SVNProperty is used to facilitate         * the work with versioned properties.         */        String mimeType = (String) fileProperties.get(SVNProperty.MIME_TYPE);        /*         * SVNProperty.isTextType method checks up the value of the mime-type         * file property and says if the file is a text (true) or not (false).         */        boolean isTextType = SVNProperty.isTextType(mimeType);        Iterator iterator = fileProperties.keySet().iterator();        /*         * Displays file properties.         */        while (iterator.hasNext()) {            String propertyName = (String) iterator.next();            String propertyValue = (String) fileProperties.get(propertyName);            System.out.println("File property: " + propertyName + "="                    + propertyValue);        }        /*         * Displays the file contents in the console if the file is a text.         */        if (isTextType) {            System.out.println("File contents:");            System.out.println();            try {                baos.writeTo(System.out);            } catch (IOException ioe) {                ioe.printStackTrace();            }        } else {            System.out                    .println("File contents can not be displayed in the console since the mime-type property says that it's not a kind of a text file.");        }        /*         * Gets the latest revision number of the repository         */        long latestRevision = -1;        try {            latestRevision = repository.getLatestRevision();        } catch (SVNException svne) {            System.err.println("error while fetching the latest repository revision: " + svne.getMessage());            System.exit(1);        }        System.out.println("");        System.out.println("---------------------------------------------");        System.out.println("Repository latest revision: " + latestRevision);        System.exit(0);    }