Coverage Report - org.apache.camel.component.file.FileMessage
 
Classes in this File Line Coverage Branch Coverage Complexity
FileMessage
54% 
N/A 
0
 
 1  
 /**
 2  
  * Licensed to the Apache Software Foundation (ASF) under one or more
 3  
  * contributor license agreements.  See the NOTICE file distributed with
 4  
  * this work for additional information regarding copyright ownership.
 5  
  * The ASF licenses this file to You under the Apache License, Version 2.0
 6  
  * (the "License"); you may not use this file except in compliance with
 7  
  * the License.  You may obtain a copy of the License at
 8  
  *
 9  
  *      http://www.apache.org/licenses/LICENSE-2.0
 10  
  *
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 package org.apache.camel.component.file;
 18  
 
 19  
 import org.apache.camel.Exchange;
 20  
 import org.apache.camel.impl.DefaultMessage;
 21  
 
 22  
 import java.io.File;
 23  
 
 24  
 /**
 25  
  * A {@link Exchange} for File
 26  
  * 
 27  
  * @version $Revision: 520985 $
 28  
  */
 29  48
 public class FileMessage extends DefaultMessage {
 30  
     private File file;
 31  
 
 32  
     public FileMessage() {
 33  0
         this(new File("."));
 34  0
     }
 35  
 
 36  57
     public FileMessage(File file) {
 37  57
         this.file = file;
 38  57
     }
 39  
 
 40  
     @Override
 41  
     public String toString() {
 42  27
         return "FileMessage: " + file;
 43  
     }
 44  
 
 45  
     @Override
 46  
     public FileExchange getExchange() {
 47  48
         return (FileExchange)super.getExchange();
 48  
     }
 49  
 
 50  
     public File getFile() {
 51  0
         return file;
 52  
     }
 53  
 
 54  
     public void setFile(File file) {
 55  0
         this.file = file;
 56  0
     }
 57  
 
 58  
     @Override
 59  
     public FileMessage newInstance() {
 60  0
         return new FileMessage();
 61  
     }
 62  
 
 63  
     @Override
 64  
     protected Object createBody() {
 65  33
         return file;
 66  
     }
 67  
 }