1 /**************************************************************** 2 * Licensed to the Apache Software Foundation (ASF) under one * 3 * or more contributor license agreements. See the NOTICE file * 4 * distributed with this work for additional information * 5 * regarding copyright ownership. The ASF licenses this file * 6 * to you under the Apache License, Version 2.0 (the * 7 * "License"); you may not use this file except in compliance * 8 * with the License. You may obtain a copy of the License at * 9 * * 10 * http://www.apache.org/licenses/LICENSE-2.0 * 11 * * 12 * Unless required by applicable law or agreed to in writing, * 13 * software distributed under the License is distributed on an * 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * 15 * KIND, either express or implied. See the License for the * 16 * specific language governing permissions and limitations * 17 * under the License. * 18 ****************************************************************/ 19 20 package org.apache.jsieve.mail; 21 22 /** 23 * Class ActionFileInto encapsulates the information required to file a mail 24 * into a location. See RFC 3028, Section 4.2. 25 */ 26 public class ActionFileInto implements Action { 27 /** 28 * A String representation of the location to which the message should be 29 * moved. 30 */ 31 private String fieldDestination; 32 33 /** 34 * Constructor for ActionFileInto. 35 */ 36 private ActionFileInto() { 37 super(); 38 } 39 40 /** 41 * Constructor for ActionFileInto. 42 */ 43 public ActionFileInto(String destination) { 44 this(); 45 setDestination(destination); 46 } 47 48 /** 49 * Returns the destination. 50 * 51 * @return String 52 */ 53 public String getDestination() { 54 return fieldDestination; 55 } 56 57 /** 58 * @see java.lang.Object#toString() 59 */ 60 public String toString() { 61 return "Action: " + getClass().getName() + ", destination: " 62 + getDestination(); 63 } 64 65 /** 66 * Sets the destination. 67 * 68 * @param destination 69 * The destination to set 70 */ 71 protected void setDestination(String destination) { 72 fieldDestination = destination; 73 } 74 75 }