View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.file.i18n;
8   
9   import org.mule.api.endpoint.EndpointURI;
10  import org.mule.api.endpoint.InboundEndpoint;
11  import org.mule.api.transport.Connector;
12  import org.mule.config.i18n.Message;
13  import org.mule.config.i18n.MessageFactory;
14  
15  import java.io.File;
16  
17  public class FileMessages extends MessageFactory
18  {
19      private static final FileMessages factory = new FileMessages();
20      
21      private static final String BUNDLE_PATH = getBundlePath("file");
22  
23      public static Message errorWhileListingFiles()
24      {
25          return factory.createMessage(BUNDLE_PATH, 1);
26      }
27  
28      public static Message exceptionWhileProcessing(String name, String string)
29      {
30          return factory.createMessage(BUNDLE_PATH, 2, name, string);
31      }
32  
33      public static Message failedToDeleteFile(File file)
34      {
35          return factory.createMessage(BUNDLE_PATH, 3, file.getAbsolutePath());
36      }
37  
38      public static Message failedToMoveFile(String from, String to)
39      {
40          return factory.createMessage(BUNDLE_PATH, 4, from, to);
41      }
42  
43      public static Message moveToDirectoryNotWritable()
44      {
45          return factory.createMessage(BUNDLE_PATH, 5);
46      }
47  
48      public static Message invalidFileFilter(EndpointURI endpointURI)
49      {
50          return factory.createMessage(BUNDLE_PATH, 6, endpointURI);
51      }
52  
53      public static Message fileDoesNotExist(String string)
54      {
55          return factory.createMessage(BUNDLE_PATH, 7, string);
56      }
57  
58      public static Message invalidFilter(Object filter)
59      {
60          return factory.createMessage(BUNDLE_PATH, 8, filter.getClass().getName());
61      }
62  
63  }
64  
65