Clover icon

Magnolia Resources Module 2.4.2

  1. Project Clover database Fri Nov 6 2015 16:15:26 CET
  2. Package info.magnolia.module.resources

File ResourcesModule.java

 

Coverage histogram

../../../../img/srcFileCovDistChart7.png
52% of files have more coverage

Code metrics

2
4
3
1
148
57
4
1
1.33
3
1.33
64% of code in this file is excluded from these metrics.

Classes

Class Line # Actions
ResourcesModule 44 4 64% 4 3
0.666666766.7%
 

Contributing tests

This file is covered by 15 tests. .

Source view

1    /**
2    * This file Copyright (c) 2008-2015 Magnolia International
3    * Ltd. (http://www.magnolia-cms.com). All rights reserved.
4    *
5    *
6    * This file is dual-licensed under both the Magnolia
7    * Network Agreement and the GNU General Public License.
8    * You may elect to use one or the other of these licenses.
9    *
10    * This file is distributed in the hope that it will be
11    * useful, but AS-IS and WITHOUT ANY WARRANTY; without even the
12    * implied warranty of MERCHANTABILITY or FITNESS FOR A
13    * PARTICULAR PURPOSE, TITLE, or NONINFRINGEMENT.
14    * Redistribution, except as permitted by whichever of the GPL
15    * or MNA you select, is prohibited.
16    *
17    * 1. For the GPL license (GPL), you can redistribute and/or
18    * modify this file under the terms of the GNU General
19    * Public License, Version 3, as published by the Free Software
20    * Foundation. You should have received a copy of the GNU
21    * General Public License, Version 3 along with this program;
22    * if not, write to the Free Software Foundation, Inc., 51
23    * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24    *
25    * 2. For the Magnolia Network Agreement (MNA), this file
26    * and the accompanying materials are made available under the
27    * terms of the MNA which accompanies this distribution, and
28    * is available at http://www.magnolia-cms.com/mna.html
29    *
30    * Any modifications to this file must keep this entire header
31    * intact.
32    *
33    */
34    package info.magnolia.module.resources;
35   
36    import info.magnolia.module.resources.loaders.ResourceLoader;
37   
38    import java.util.ArrayList;
39    import java.util.List;
40   
41    /**
42    * Resources module class.
43    */
 
44    public class ResourcesModule {
45   
46    /**
47    * @deprecated since 2.4
48    */
49    @Deprecated
50    private static ResourcesModule instance;
51   
52    /**
53    * @deprecated since 2.4 Resources are now served through the {@link info.magnolia.resourceloader.ResourceOrigin} API.
54    */
55    public static final String DEFAULT_WORKSPACE = "resources";
56   
57    /**
58    * @deprecated since 2.2.1, use {@link ResourceTypes#RESOURCES_PREFIX} instead.
59    */
60    public static final String MODULE_NAME_PREFIX = "resources:";
61   
62    private String repository = DEFAULT_WORKSPACE;
63   
64    private List<ResourceLoader> resourceLoaders = new ArrayList<ResourceLoader>();
65   
66    private boolean versionOnSave;
67   
68    private String downloadPath = "/.resources/";
69   
 
70  42 toggle public ResourcesModule() {
71  42 instance = this;
72    }
73   
 
74    toggle public String getDownloadPath() {
75    return downloadPath;
76    }
77   
 
78    toggle public void setDownloadPath(String downloadPath) {
79    this.downloadPath = downloadPath;
80    }
81   
82    /**
83    * @deprecated since 2.4 - use IoC
84    */
 
85    toggle @Deprecated
86    public static ResourcesModule getInstance() {
87    return instance;
88    }
89   
90    /**
91    * @deprecated since 2.4 Resources are now served through the {@link info.magnolia.resourceloader.ResourceOrigin} API.
92    */
 
93    toggle @Deprecated
94    public String getRepository() {
95    return repository;
96    }
97   
98    /**
99    * @deprecated since 2.4 Resources are now served through the {@link info.magnolia.resourceloader.ResourceOrigin} API.
100    */
 
101  0 toggle @Deprecated
102    protected void setRepository(String repository) {
103  0 this.repository = repository;
104    }
105   
106    /**
107    * @deprecated since 2.4 Resources are now served through the {@link info.magnolia.resourceloader.ResourceOrigin} API.
108    */
 
109    toggle @Deprecated
110    public void setResourceLoaders(List<ResourceLoader> loaders) {
111    this.resourceLoaders = loaders;
112    }
113   
114    /**
115    * @deprecated since 2.4 Resources are now served through the {@link info.magnolia.resourceloader.ResourceOrigin} API.
116    */
 
117  8 toggle @Deprecated
118    public void addResourceLoader(ResourceLoader loader) {
119  8 if (loader.isEnabled()) {
120  8 this.resourceLoaders.add(loader);
121    }
122    }
123   
124    /**
125    * @deprecated since 2.4 Resources are now served through the {@link info.magnolia.resourceloader.ResourceOrigin} API.
126    */
 
127    toggle @Deprecated
128    public List<ResourceLoader> getResourceLoaders() {
129    return this.resourceLoaders;
130    }
131   
132    /**
133    * @deprecated Marked deprecated since 2.4, usage was removed in 2.2
134    */
 
135    toggle @Deprecated
136    public boolean isVersionOnSave() {
137    return versionOnSave;
138    }
139   
140    /**
141    * @deprecated Marked deprecated since 2.4, usage was removed in 2.2
142    */
 
143    toggle @Deprecated
144    public void setVersionOnSave(boolean versionOnSave) {
145    this.versionOnSave = versionOnSave;
146    }
147   
148    }