View Javadoc

1   /**
2    * Copyright (C) 2010-2012 Joerg Bellmann <joerg.bellmann@googlemail.com>
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *         http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package com.googlecode.t7mp.scanner;
17  
18  import java.io.File;
19  import java.util.List;
20  
21  import com.google.common.base.Splitter;
22  import com.google.common.collect.Lists;
23  
24  public class ScannerConfiguration {
25  
26      private static final String DEFAULT_ENDINGS = ".html,.xhtml,.css,.js,.jsp,.jspx,.properties,.txt,.jpg,.gif,.png";
27      private static final int DEFAULT_INTERVAL = 10;
28  
29      private int interval = DEFAULT_INTERVAL;
30      private File rootDirectory;
31      private File webappDirectory;
32      private String endings = DEFAULT_ENDINGS;
33      private List<String> endingsList;
34  
35      public int getInterval() {
36          return interval;
37      }
38  
39      public void setInterval(int interval) {
40          this.interval = interval;
41      }
42  
43      public File getRootDirectory() {
44          return rootDirectory;
45      }
46  
47      public void setRootDirectory(File rootDirectory) {
48          this.rootDirectory = rootDirectory;
49      }
50  
51      public File getWebappDirectory() {
52          return webappDirectory;
53      }
54  
55      public void setWebappDirectory(File webappDirectory) {
56          this.webappDirectory = webappDirectory;
57      }
58  
59      public String getEndings() {
60          return endings;
61      }
62  
63      public void setEndings(String endings) {
64          if ("%".equals(endings)) {
65              endings = "";
66          }
67          this.endings = endings;
68      }
69  
70      public List<String> getEndingsAsList() {
71          if (endingsList == null) {
72              endingsList = Lists.newArrayList(Splitter.on(",").split(endings));
73          }
74          return endingsList;
75      }
76  }