Code Search for Developers
 
 
  

RelativePathConfigurator.java from Kneobase at Krugle


Show RelativePathConfigurator.java syntax highlighted

package com.kneobase.web.util;

import javax.servlet.ServletContext;

import org.springframework.web.context.ServletContextAware;

import com.kneobase.util.I_PathInfo;

/**
 * @author patricio.keilty@colaborativa.net
 *
 */
public class RelativePathConfigurator implements ServletContextAware, I_PathInfo {

	private String _path;
	private static String _realPath;

	public RelativePathConfigurator( String path ){
		_path = path;
	}

	/**
	 * @see org.springframework.web.context.ServletContextAware#setServletContext(javax.servlet.ServletContext)
	 */
	public void setServletContext( ServletContext arg0 ){
		_realPath = arg0.getRealPath( "/" );
        // Linuxes patch
        // apparently absolute paths must start with //// ( 4 slashes )
        if( _realPath.startsWith( "/" ) )
            _realPath = "///" + _realPath; 
	}

	/**
	 * @see I_PathInfo#getPath()
	 */
	public String getPath() {
		return _realPath + _path;
	}

}




See more files for this project here

Kneobase

Kneobase is an enterprise search engine, based upon the Lucene search engine and the Spring framework. It allows to perform full-text search across many different content sources. It is highly adaptable out-of-the-box and has a pluggable architecture.

Project homepage: http://sourceforge.net/projects/kneobase
Programming language(s): Java,XML
License: other

  RelativePathConfigurator.java
  RobotLoggerPathConfigurator.java
  ZipContentServlet.java