View Javadoc

1   /*
2    * Copyright 2013 smartics, Kronseder & Reiner GmbH
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 de.smartics.properties.config.transfer.filesystem;
17  
18  import java.io.File;
19  
20  import de.smartics.exceptions.i18n.message.MessageParam;
21  import de.smartics.properties.api.config.domain.ConfigurationMessageBean;
22  import de.smartics.properties.api.config.domain.key.ConfigurationKey;
23  
24  /**
25   * Provides context information for transfer problems.
26   */
27  public class TransferMessageBean extends ConfigurationMessageBean
28  {
29    // ********************************* Fields *********************************
30  
31    // --- constants ------------------------------------------------------------
32  
33    /**
34     * The class version identifier.
35     */
36    private static final long serialVersionUID = 1L;
37  
38    // --- members --------------------------------------------------------------
39  
40    /**
41     * The target folder involved in the transfer problem.
42     *
43     * @serial
44     */
45    @MessageParam(":absolutePath")
46    private final File targetFolder; // NOPMD
47  
48    // ****************************** Initializer *******************************
49  
50    // ****************************** Constructors ******************************
51  
52    /**
53     * Constructor without cause.
54     *
55     * @param code the error or exception code of the exception.
56     * @param key the key to the configuration that signaled problems.
57     * @param targetFolder the target folder involved in the transfer problem.
58     */
59    public TransferMessageBean(final TransferFileCode code,
60        final ConfigurationKey<?> key, final File targetFolder)
61    {
62      this(code, null, key, targetFolder);
63    }
64  
65    /**
66     * Default constructor.
67     *
68     * @param code the error or exception code of the exception.
69     * @param cause the cause to the problem.
70     * @param key the key to the configuration that signaled problems.
71     * @param targetFolder the target folder involved in the transfer problem.
72     */
73    public TransferMessageBean(final TransferFileCode code,
74        final Throwable cause, final ConfigurationKey<?> key,
75        final File targetFolder)
76    {
77      super(code, cause, key);
78      this.targetFolder = targetFolder;
79    }
80  
81    // ****************************** Inner Classes *****************************
82  
83    // ********************************* Methods ********************************
84  
85    // --- init -----------------------------------------------------------------
86  
87    // --- factory --------------------------------------------------------------
88  
89    // --- get&set --------------------------------------------------------------
90  
91    // --- business -------------------------------------------------------------
92  
93    // --- object basics --------------------------------------------------------
94  
95  }