• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2010 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 
17 package com.android.sdklib.build;
18 
19 import com.android.sdklib.internal.build.SignedJarBuilder.IZipEntryFilter.ZipAbortException;
20 
21 import java.io.File;
22 
23 /**
24  * An exception thrown during packaging of an APK file.
25  */
26 public final class DuplicateFileException extends ZipAbortException {
27     private static final long serialVersionUID = 1L;
28     private final String mArchivePath;
29     private final File mFile1;
30     private final File mFile2;
31 
DuplicateFileException(String archivePath, File file1, File file2)32     public DuplicateFileException(String archivePath, File file1, File file2) {
33         super();
34         mArchivePath = archivePath;
35         mFile1 = file1;
36         mFile2 = file2;
37     }
38 
getArchivePath()39     public String getArchivePath() {
40         return mArchivePath;
41     }
42 
getFile1()43     public File getFile1() {
44         return mFile1;
45     }
46 
getFile2()47     public File getFile2() {
48         return mFile2;
49     }
50 
51     @Override
getMessage()52     public String getMessage() {
53         return "Duplicate files at the same path inside the APK";
54     }
55 }