1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.extension.repository.internal.local

File DefaultLocalExtension.java

 

Coverage histogram

../../../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
7
6
1
96
36
6
0.86
1.17
6
1

Classes

Class Line # Actions
DefaultLocalExtension 35 7 0% 6 0
1.0100%
 

Contributing tests

This file is covered by 119 tests. .

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.extension.repository.internal.local;
21   
22    import java.io.File;
23   
24    import org.xwiki.extension.AbstractExtension;
25    import org.xwiki.extension.Extension;
26    import org.xwiki.extension.ExtensionId;
27    import org.xwiki.extension.LocalExtension;
28   
29    /**
30    * Default implementation of {@link LocalExtension}.
31    *
32    * @version $Id: 41a089117dc9914037596c8a76c8dae9c474997e $
33    * @since 4.0M1
34    */
 
35    public class DefaultLocalExtension extends AbstractExtension implements LocalExtension
36    {
37    /**
38    * @see #getDescriptorFile()
39    */
40    private File descriptorFile;
41   
42    /**
43    * @param repository the repository where this extension comes from
44    * @param id the extension identifier
45    * @param type the extension type
46    */
 
47  1550 toggle public DefaultLocalExtension(DefaultLocalExtensionRepository repository, ExtensionId id, String type)
48    {
49  1550 super(repository, id, type);
50    }
51   
52    /**
53    * Create new extension descriptor by copying provided one.
54    *
55    * @param repository the repository where this extension comes from
56    * @param extension the extension to copy
57    */
 
58  148 toggle public DefaultLocalExtension(DefaultLocalExtensionRepository repository, Extension extension)
59    {
60  148 super(repository, extension);
61    }
62   
63    /**
64    * @return the file containing the extension description
65    */
 
66  487 toggle public File getDescriptorFile()
67    {
68  487 return this.descriptorFile;
69    }
70   
71    /**
72    * @param descriptorFile file containing the extension description
73    */
 
74  1485 toggle public void setDescriptorFile(File descriptorFile)
75    {
76  1485 this.descriptorFile = descriptorFile;
77    }
78   
79    /**
80    * @param file the extension file in the filesystem
81    * @see #getFile()
82    */
 
83  1494 toggle public void setFile(File file)
84    {
85  1494 setFile(new DefaultLocalExtensionFile(file));
86  1494 putProperty(PKEY_FILE, file);
87    }
88   
89    // LocalExtension
90   
 
91  2175 toggle @Override
92    public DefaultLocalExtensionFile getFile()
93    {
94  2175 return (DefaultLocalExtensionFile) super.getFile();
95    }
96    }