View Javadoc
1   /*
2    * Copyright (C) 2010-2014 Hamburg Sud and the contributors.
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 org.aludratest.service.file;
17  
18  import org.aludratest.config.ConfigProperties;
19  import org.aludratest.config.ConfigProperty;
20  import org.aludratest.service.AludraService;
21  import org.aludratest.service.ServiceInterface;
22  
23  /** An AludraTest service which provides access to and file operations on local and network file systems as well as on (S)FTP and
24   * HTTP(S) servers.
25   * @author Volker Bergmann */
26  @ServiceInterface(name = "File Service", description = "Offers file related access and verifaction methods.")
27  @ConfigProperties({
28      @ConfigProperty(name = "protocol", type = String.class, description = "The name of the used protocol: file, ftp, sftp, http or https.", defaultValue = "file", required = true),
29      @ConfigProperty(name = "base.url", type = String.class, description = "The base URL of the service. On a local filesystem, this is a folder path.", defaultValue = "${user.home}", required = true),
30      @ConfigProperty(name = "encoding", type = String.class, description = "The encoding to use when reading / writing text files.", defaultValue = "UTF-8", required = true),
31      @ConfigProperty(name = "linefeed", type = String.class, description = "The line feed to use when reading / writing text files. Can be WINDOWS or UNIX", defaultValue = "UNIX", required = true),
32      @ConfigProperty(name = "writing.permitted", type = boolean.class, description = "Activates a \"write lock\" if set to false, so all modification operations on this file system will fail.", defaultValue = "false", required = true),
33      @ConfigProperty(name = "user", type = String.class, description = "The user name to use for login purposes (unused for file protocol)", required = false),
34      @ConfigProperty(name = "password", type = String.class, description = "The password to use for login purposes (unused for file protocol)", required = false) })
35  public interface FileService extends AludraService {
36  
37      /** @see AludraService#perform() */
38      @Override
39      FileInteraction perform();
40  
41      /** @see AludraService#verify() */
42      @Override
43      FileVerification verify();
44  
45      /** @see AludraService#check() */
46      @Override
47      FileCondition check();
48  
49  }