1 /*
2 * Copyright 2003 - 2013 The eFaps Team
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 * Revision: $Rev$
17 * Last Changed: $Date$
18 * Last Changed By: $Author$
19 */
20
21 package org.efaps.update;
22
23 import java.net.URL;
24 import java.util.List;
25 import java.util.Map;
26 import java.util.Set;
27
28 import org.apache.commons.jexl2.JexlContext;
29 import org.efaps.update.util.InstallationException;
30 import org.slf4j.Logger;
31 import org.slf4j.LoggerFactory;
32 import org.xml.sax.SAXException;
33
34 /**
35 * TODO comment!
36 *
37 * @author The eFaps Team
38 * @version $Id$
39 */
40 public class DefaultEmptyUpdate
41 implements IUpdate
42 {
43 /**
44 * Logging instance used to give logging information of this class.
45 */
46 public static final Logger LOG = LoggerFactory.getLogger(DefaultEmptyUpdate.class);
47
48 /**
49 * Url of the update file.
50 */
51 private final URL url;
52
53 /**
54 * @param _url url of the update file
55 */
56 public DefaultEmptyUpdate(final URL _url)
57 {
58 this.url = _url;
59 DefaultEmptyUpdate.LOG.debug("Ignoring file: '{}'", _url);
60 }
61
62 @Override
63 public void updateInDB(final JexlContext _jexlContext,
64 final UpdateLifecycle _step,
65 final Set<Profile> _profiles)
66 throws InstallationException
67 {
68 // nothing will be done at all
69 }
70
71 @Override
72 public String getFileApplication()
73 {
74 return "Empty";
75 }
76
77 @Override
78 public void readXML(final List<String> _tags,
79 final Map<String, String> _attributes,
80 final String _text)
81 throws SAXException
82 {
83 // nothing will be done at all
84 }
85
86 @Override
87 public URL getURL()
88 {
89 return this.url;
90 }
91 }