Login
Checkout.java at [39121d2e23]
Login

File src/org/fossil_scm/libfossil/Checkout.java artifact 6e58a47089 part of check-in 39121d2e23


/*******************************************************************************
 * 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);

}