[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.technology.laszlo] Re: Invalid LPS web root with Laszlo 3.2cr2!

Look for lps .jar at correct location!

Source Code: LaszloCompilerUtils.java

CVS repository: http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.laszlo/source/org.eclipse.laszlo.rct.lzx.core/src/org/eclipse/laszlo/rct/lzx/builder/compiler/LaszloCompilerUtils.java?rev=1.4&cvsroot=Technology_Project&content-type=text/vnd.viewcvs-markup

/*
* Copyright (c) 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
* * Contributors:
* IBM - Initial implementation
* */
package org.eclipse.laszlo.rct.lzx.builder.compiler;


import java.io.File;

import org.eclipse.core.runtime.Path;

public class LaszloCompilerUtils {

	protected static final String LPS_MINIMUM_VERSION = "3.1";
	
	public static boolean isValidLPSRoot(String lpsRoot) {
		
		if(lpsRoot == null || lpsRoot.equals(""))
			return false;
		File f = new File(lpsRoot);
		if(f.exists() && f.isDirectory()) {
			//Check for LPS 3.1
			File nf = new File(lpsRoot + "/WEB-INF/lib");
			if(nf.exists() && nf.isDirectory()) {
				String[] list = nf.list();
				for(int i=list.length-1; i>=0; i--) {
					if(list[i].indexOf(LPS_MINIMUM_VERSION) != -1)
						return true;
				}
			}
		}
		return false;
	}

}