1 /*
2  * Copyright (C) 2016 The Android Open Source Project
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 com.android.tradefed.util;
17 
18 import com.android.tradefed.result.LogDataType;
19 
20 import java.io.File;
21 import java.io.IOException;
22 
23 /**
24  * An interface representing a compression algorithm that can be selected at runtime.
25  */
26 public interface ICompressionStrategy {
27     /**
28      * Compresses the {@code source} file (or folder) and returns the resulting archive.
29      *
30      * @param source The file or directory to compress
31      * @return The compressed archive
32      * @throws IOException If the operation could not be completed
33      */
compress(File source)34     public File compress(File source) throws IOException;
35 
36     /** Returns the {@link LogDataType} of the archive format used by this strategy. */
getLogDataType()37     public LogDataType getLogDataType();
38 }
39