[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!

Big Magician wrote:
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;
}


}



Thankyou indeed, I see the silly bit of code ('list[i].indexOf(LPS_MINIMUM_VERSION) != -1' BAH!), and I'll change it to accept any version greater than 3.1 for my version... or just make it always return true and let me handle the consequences! :D


Thanks again, I didn't have the time to track this down.

Simon