Login
Artifact [6e58a47089]
Login

Artifact 6e58a47089d3f4911c9386c25bac36c8e98d4d21:


/*******************************************************************************
 * Copyright (c) 
 ******************************************************************************/
package org.fossil_scm.libfossil;



/**
 * The wrapper for a Checkout
 */
public class Checkout {

	public static int NESTED = 1;
	public static int CREATE = 2;

	long handle;

	static {
	  System.loadLibrary("libfossil");
	}

	/**
	 * The constructor
	 * 
	 */
	public Checkout(String dir, int flags) {
		handle = open(dir, flags);
	}

	public synchronized void finalize() {
		if( handle != 0 ){
			dispose(handle);
		}
		handle = 0;
	}

	public synchronized void dispose() {
		if( handle != 0 ){
			dispose(handle);
		}
		handle = 0;
	}

	private static native long open(String dir, int flags);
	private static native void dispose(long handle);

}