// Path: src/main/java/crawlercommons/util/HttpFetcherVersion.java
// public class HttpFetcherVersion {
// 
//     public static String getVersion() {
//         String path = "/version.prop";
//         InputStream stream = HttpFetcherVersion.class.getResourceAsStream(path);
//         if (stream == null) {
//             return "Unknown Version";
//         }
// 
//         Properties props = new Properties();
//         try {
//             props.load(stream);
//             stream.close();
//             return (String) props.get("version");
//         } catch (IOException e) {
//             return "Unknown Version";
//         }
//     }
// }


import java.io.Serializable;
import java.util.Locale;
import crawlercommons.util.HttpFetcherVersion;
/**
 * Copyright 2016 Crawler-Commons
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package crawlercommons.fetcher.http;



/**
 * User Agent enables us to describe characteristics of any http-fetcher
 * agent. There are a number of constructor options to describe the following:
 * <ol>
 * <li><tt>_agentName</tt>: Primary agent name.</li>
 * <li><tt>_emailAddress</tt>: The agent owners email address.</li>
 * <li><tt>_webAddress</tt>: A web site/address representing the agent owner.</li>
 * <li><tt>_browserVersion</tt>: Broswer version used for compatibility.</li>
 * <li><tt>_crawlerVersion</tt>: Version of the user agents personal crawler. If
 * this is not set, it defaults to the http-fetcher maven artifact version.</li>
 * </ol>
 * 
 */
@SuppressWarnings("serial")
public class UserAgent implements Serializable {

    public static final String DEFAULT_BROWSER_VERSION = "Mozilla/5.0";
// Path: src/main/java/crawlercommons/util/HttpFetcherVersion.java
// public class HttpFetcherVersion {
// 
//     public static String getVersion() {
//         String path = "/version.prop";
//         InputStream stream = HttpFetcherVersion.class.getResourceAsStream(path);
//         if (stream == null) {
//             return "Unknown Version";
//         }
// 
//         Properties props = new Properties();
//         try {
//             props.load(stream);
//             stream.close();
//             return (String) props.get("version");
//         } catch (IOException e) {
//             return "Unknown Version";
//         }
//     }
// }


// Path: src/main/java/crawlercommons/fetcher/http/UserAgent.java
import java.io.Serializable;
import java.util.Locale;
import crawlercommons.util.HttpFetcherVersion;

/**
 * Copyright 2016 Crawler-Commons
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package crawlercommons.fetcher.http;



/**
 * User Agent enables us to describe characteristics of any http-fetcher
 * agent. There are a number of constructor options to describe the following:
 * <ol>
 * <li><tt>_agentName</tt>: Primary agent name.</li>
 * <li><tt>_emailAddress</tt>: The agent owners email address.</li>
 * <li><tt>_webAddress</tt>: A web site/address representing the agent owner.</li>
 * <li><tt>_browserVersion</tt>: Broswer version used for compatibility.</li>
 * <li><tt>_crawlerVersion</tt>: Version of the user agents personal crawler. If
 * this is not set, it defaults to the http-fetcher maven artifact version.</li>
 * </ol>
 * 
 */
@SuppressWarnings("serial")
public class UserAgent implements Serializable {

    public static final String DEFAULT_BROWSER_VERSION = "Mozilla/5.0";
    public static final String DEFAULT_CRAWLER_VERSION = HttpFetcherVersion.getVersion();