~ubuntu-branches/ubuntu/wily/proguard/wily

« back to all changes in this revision

Viewing changes to src/proguard/ClassPathEntry.java

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg
  • Date: 2014-04-10 13:58:11 UTC
  • mfrom: (1.2.5)
  • Revision ID: package-import@ubuntu.com-20140410135811-ddwzt2avu94rnolt
Tags: 4.11-1
* Team upload.
* New upstream release
* Removed the non-free documentation from the package (Closes: #719706)
* Removed the pre-built jars from the upstream tarball
* debian/control:
  - The package is now co-maintained with the Java Team
  - Standards-Version updated to 3.9.5 (no changes)
  - Added the Vcs-* fields
  - Added the Homepage field
* Switch to debhelper level 9
* Use XZ compression for the upstream tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * ProGuard -- shrinking, optimization, obfuscation, and preverification
3
3
 *             of Java bytecode.
4
4
 *
5
 
 * Copyright (c) 2002-2012 Eric Lafortune (eric@graphics.cornell.edu)
 
5
 * Copyright (c) 2002-2013 Eric Lafortune (eric@graphics.cornell.edu)
6
6
 *
7
7
 * This program is free software; you can redistribute it and/or modify it
8
8
 * under the terms of the GNU General Public License as published by the Free
27
27
 
28
28
 
29
29
/**
30
 
 * This class represents an entry from a class path: a jar, a war, a zip, an
31
 
 * ear, or a directory, with a name and a flag to indicates whether the entry is
32
 
 * an input entry or an output entry. Optional filters can be specified for the
33
 
 * names of the contained resource/classes, jars, wars, ears, and zips.
 
30
 * This class represents an entry from a class path: an apk, a jar, an aar, a
 
31
 * war, a zip, an ear, or a directory, with a name and a flag to indicates
 
32
 * whether the entry is an input entry or an output entry. Optional filters can
 
33
 * be specified for the names of the contained resource/classes, apks, jars,
 
34
 * aars, wars, ears, and zips.
34
35
 *
35
36
 * @author Eric Lafortune
36
37
 */
39
40
    private File    file;
40
41
    private boolean output;
41
42
    private List    filter;
 
43
    private List    apkFilter;
42
44
    private List    jarFilter;
 
45
    private List    aarFilter;
43
46
    private List    warFilter;
44
47
    private List    earFilter;
45
48
    private List    zipFilter;
108
111
 
109
112
 
110
113
    /**
 
114
     * Returns whether this data entry is a dex file.
 
115
     */
 
116
    public boolean isDex()
 
117
    {
 
118
        return hasExtension(".dex");
 
119
    }
 
120
 
 
121
 
 
122
    /**
 
123
     * Returns whether this data entry is an apk file.
 
124
     */
 
125
    public boolean isApk()
 
126
    {
 
127
        return hasExtension(".apk") ||
 
128
               hasExtension(".ap_");
 
129
    }
 
130
 
 
131
 
 
132
    /**
111
133
     * Returns whether this data entry is a jar file.
112
134
     */
113
135
    public boolean isJar()
117
139
 
118
140
 
119
141
    /**
 
142
     * Returns whether this data entry is an aar file.
 
143
     */
 
144
    public boolean isAar()
 
145
    {
 
146
        return hasExtension(".aar");
 
147
    }
 
148
 
 
149
 
 
150
    /**
120
151
     * Returns whether this data entry is a war file.
121
152
     */
122
153
    public boolean isWar()
184
215
 
185
216
 
186
217
    /**
 
218
     * Returns the name filter that is applied to apk files in this entry, if any.
 
219
     */
 
220
    public List getApkFilter()
 
221
    {
 
222
        return apkFilter;
 
223
    }
 
224
 
 
225
    /**
 
226
     * Sets the name filter that is applied to apk files in this entry, if any.
 
227
     */
 
228
    public void setApkFilter(List filter)
 
229
    {
 
230
        this.apkFilter = filter == null || filter.size() == 0 ? null : filter;
 
231
    }
 
232
 
 
233
 
 
234
    /**
187
235
     * Returns the name filter that is applied to jar files in this entry, if any.
188
236
     */
189
237
    public List getJarFilter()
201
249
 
202
250
 
203
251
    /**
 
252
     * Returns the name filter that is applied to aar files in this entry, if any.
 
253
     */
 
254
    public List getAarFilter()
 
255
    {
 
256
        return aarFilter;
 
257
    }
 
258
 
 
259
    /**
 
260
     * Sets the name filter that is applied to aar files in this entry, if any.
 
261
     */
 
262
    public void setAarFilter(List filter)
 
263
    {
 
264
        this.aarFilter = filter == null || filter.size() == 0 ? null : filter;
 
265
    }
 
266
 
 
267
 
 
268
    /**
204
269
     * Returns the name filter that is applied to war files in this entry, if any.
205
270
     */
206
271
    public List getWarFilter()
259
324
 
260
325
        if (filter    != null ||
261
326
            jarFilter != null ||
 
327
            aarFilter != null ||
262
328
            warFilter != null ||
263
329
            earFilter != null ||
264
330
            zipFilter != null)
265
331
        {
266
332
            string +=
267
333
                ConfigurationConstants.OPEN_ARGUMENTS_KEYWORD +
 
334
                (aarFilter != null ? ListUtil.commaSeparatedString(aarFilter, true) : "")  +
 
335
                ConfigurationConstants.SEPARATOR_KEYWORD +
 
336
                (apkFilter != null ? ListUtil.commaSeparatedString(apkFilter, true) : "")  +
 
337
                ConfigurationConstants.SEPARATOR_KEYWORD +
268
338
                (zipFilter != null ? ListUtil.commaSeparatedString(zipFilter, true) : "")  +
269
339
                ConfigurationConstants.SEPARATOR_KEYWORD +
270
340
                (earFilter != null ? ListUtil.commaSeparatedString(earFilter, true) : "")  +