Package org.springframework.core.io

Examples of org.springframework.core.io.ClassPathResource


      return;

    if (this.configuration == null) {
      if (log.isDebugEnabled())
        log.debug("no configuration resource specified, using the default one:" + DEFAULT_CONF_FILE);
      configuration = new ClassPathResource(DEFAULT_CONF_FILE);
    }

    if (homeDir == null) {
      if (log.isDebugEnabled())
        log.debug("no repository home dir specified, using the default one:" + DEFAULT_REP_DIR);
View Full Code Here


        {
            // resolve the configuration
            if (configuration == null) {
                if (log.isDebugEnabled())
                    log.debug("no configuration resource specified, using the default one:" + DEFAULT_CONF_FILE);
                configuration = new ClassPathResource(DEFAULT_CONF_FILE);
            }
            configManager = new DefaultConfigManager(configuration.getInputStream());
        }
    }
View Full Code Here

import org.springmodules.lucene.index.DocumentHandlerException;

public class PropertiesDocumentHandlerTests extends TestCase {
  public void testGetDocument() throws Exception {
    PropertiesDocumentHandler documentHandler = new PropertiesDocumentHandler();
    documentHandler.setPropertiesFileName(new ClassPathResource(
        "/org/springmodules/lucene/index/document/handler/object/mapping.properties"));

    TestBean bean = new TestBean();
    bean.setField1("field1");
    bean.setField2(2);
View Full Code Here

    assertTrue(typeField3.startsWith("stored/uncompressed,indexed<"));
  }

  public void testClassNotSupported() throws Exception {
    PropertiesDocumentHandler documentHandler = new PropertiesDocumentHandler();
    documentHandler.setPropertiesFileName(new ClassPathResource(
        "/org/springmodules/lucene/index/support/handler/object/mapping.properties"));
    try {
      documentHandler.getDocument(new HashMap(), "test");
      fail();
    } catch (DocumentHandlerException ex) {
View Full Code Here

import junit.framework.TestCase;

public class DefaultRtfDocumentHandlerTests extends TestCase {
  private Resource getRtfResource() {
    return new ClassPathResource("/org/springmodules/lucene/index/document/handler/file/quick.rtf");
  }
View Full Code Here

import junit.framework.TestCase;

public class PoiWordDocumentHandlerTests extends TestCase {

  private Resource getWordResource() {
    return new ClassPathResource("/org/springmodules/lucene/index/document/handler/file/quick.doc");
  }
View Full Code Here

import org.springframework.core.io.Resource;
import org.springmodules.lucene.util.IOUtils;

public class JExcelDocumentHandlerTests extends TestCase {
  private Resource getExcelResource() {
    return new ClassPathResource("/org/springmodules/lucene/index/document/handler/file/quick.xls");
  }
View Full Code Here

import org.springmodules.lucene.util.IOUtils;

public class PdfBoxDocumentHandlerTests extends TestCase {

  private Resource getPdfResource() {
    return new ClassPathResource("/org/springmodules/lucene/index/document/handler/file/quick.pdf");
  }
View Full Code Here

public class JackrabbitNamespaceHandlerTests extends TestCase {

  private XmlBeanFactory beanFactory;

  protected void setUp() throws Exception {
    this.beanFactory = new XmlBeanFactory(new ClassPathResource(
        "/org/springmodules/jcr/jackrabbit/config/jackrabbitNamespaceHandlerTests.xml", getClass()));
  }
View Full Code Here

  protected void setUp() throws Exception {
  }

  protected void tearDown() throws Exception {
    //Index deleting
    Resource resource = new ClassPathResource("/org/springmodules/lucene/index/support/segments");
    try {
      if( resource.exists() ) {
        File indexFile = resource.getFile();
        indexFile.delete();
      }
    } catch(FileNotFoundException ex) { ex.printStackTrace(); }
  }
View Full Code Here

TOP

Related Classes of org.springframework.core.io.ClassPathResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.