View Javadoc
1   /* 
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.felix.obrplugin;
20  
21  
22  import java.net.URI;
23  
24  
25  /**
26   * this class is used to store some user information about configuration of the plugin.
27   * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
28   *
29   */
30  public class Config
31  {
32      private boolean m_pathRelative; // use relative or absolute path in repository.xml
33      private boolean m_remoteFile; // deploy file on remote server
34      private URI m_remoteBundle; // public address of deployed bundle
35  
36  
37      /**
38       * constructor: set default configuration: use relative path and don't upload file.
39       */
40      public Config()
41      {
42          // default configuration
43          m_pathRelative = true;
44          m_remoteFile = false;
45          m_remoteBundle = null;
46      }
47  
48  
49      /**
50       * @param value enable to use relative path
51       */
52      public void setPathRelative( boolean value )
53      {
54          m_pathRelative = value;
55      }
56  
57  
58      /**
59       * @param value enable when uploading
60       */
61      public void setRemoteFile( boolean value )
62      {
63          m_remoteFile = value;
64      }
65  
66  
67      /**
68       * @param value public address of deployed bundle
69       */
70      public void setRemoteBundle( URI value )
71      {
72          m_remoteBundle = value;
73      }
74  
75  
76      /**
77       * @return true if plugin uses relative path, else false
78       */
79      public boolean isPathRelative()
80      {
81          return m_pathRelative;
82      }
83  
84  
85      /**
86       * @return true if the file will be uploaded, else false
87       */
88      public boolean isRemoteFile()
89      {
90          return m_remoteFile;
91      }
92  
93  
94      /**
95       * @return public address of deployed bundle
96       */
97      public URI getRemoteBundle()
98      {
99          return m_remoteBundle;
100     }
101 }