com.nec.harvest.jasperreport.resolver.JasperReportResolver.java Source code

Java tutorial

Introduction

Here is the source code for com.nec.harvest.jasperreport.resolver.JasperReportResolver.java

Source

/*
 * Copyright(C) 2014
 * NEC Corporation All rights reserved.
 * 
 * No permission to use, copy, modify and distribute this software
 * and its documentation for any purpose is granted.
 * This software is provided under applicable license agreement only.
 */
package com.nec.harvest.jasperreport.resolver;

import org.apache.commons.lang.StringUtils;

/**
 * @author sondn
 *
 */
public class JasperReportResolver {

    private static final String DEFAULT_PATH = "target/jasperreport";

    // Jasper Report Path
    private final String reportPath;

    public JasperReportResolver(String jasperreport) {
        reportPath = jasperreport;
    }

    /**
     * Get report path
     * 
     * @return
     */
    public String getReportPath() {
        return StringUtils.isNotEmpty(reportPath) ? reportPath : getDefaultPath();
    }

    /**
     * Get default report path
     * 
     * @return
     */
    public String getDefaultPath() {
        return DEFAULT_PATH;
    }

}