View Javadoc

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