Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Webtools Releng
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eclipse Projects
webtools
Releng
Webtools Releng
Commits
b9af0dbc
Commit
b9af0dbc
authored
18 years ago
by
jlanuti
Browse files
Options
Downloads
Patches
Plain Diff
[179728] fix for zip file size exceptions on wars
parent
a499de05
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
archive/releng.builder/tools/apitools/org.eclipse.wtp.releng.tools.component.core/src/org/eclipse/wtp/releng/tools/component/internal/Location.java
+50
-66
50 additions, 66 deletions
...eclipse/wtp/releng/tools/component/internal/Location.java
with
50 additions
and
66 deletions
archive/releng.builder/tools/apitools/org.eclipse.wtp.releng.tools.component.core/src/org/eclipse/wtp/releng/tools/component/internal/Location.java
+
50
−
66
View file @
b9af0dbc
...
...
@@ -106,80 +106,64 @@ public abstract class Location implements ILocation
}
/**
* Answers <code>true</code> if the path ends in ".jar", ".zip", ".ear", or
* ".war".
* Answers <code>true</code> if the path ends in ".jar", ".zip", or ".ear"
* <p>
* This code has been optimized to within an inch of its life.
*
* @param path
* The path of the file
* @return boolean <code>true</code> if the path represents a jar, zip, ear,
* or war file.
* @return boolean <code>true</code> if the path represents a jar, zip, ear
*/
public
static
boolean
isArchive
(
String
path
)
{
if
(
path
==
null
)
return
false
;
if
(
path
.
length
()
<
5
)
return
false
;
int
index
=
path
.
length
()
-
1
;
char
extChar
=
path
.
charAt
(
index
--);
switch
(
extChar
)
{
case
'p'
:
case
'P'
:
if
(
path
.
endsWith
(
".zip"
))
{
return
true
;
}
break
;
case
'r'
:
case
'R'
:
extChar
=
path
.
charAt
(
index
--);
switch
(
extChar
)
{
case
'a'
:
case
'A'
:
extChar
=
path
.
charAt
(
index
--);
switch
(
extChar
)
{
case
'j'
:
case
'J'
:
if
(
path
.
charAt
(
index
)
==
'.'
)
{
return
true
;
}
break
;
case
'w'
:
case
'W'
:
if
(
path
.
charAt
(
index
)
==
'.'
)
{
return
true
;
}
break
;
case
'e'
:
case
'E'
:
if
(
path
.
charAt
(
index
)
==
'.'
)
{
return
true
;
}
break
;
}
}
break
;
}
return
false
;
}
public
static
boolean
isArchive
(
String
path
)
{
if
(
path
==
null
)
return
false
;
if
(
path
.
length
()
<
5
)
return
false
;
int
index
=
path
.
length
()
-
1
;
char
extChar
=
path
.
charAt
(
index
--);
switch
(
extChar
)
{
case
'p'
:
case
'P'
:
if
(
path
.
endsWith
(
".zip"
))
{
return
true
;
}
break
;
case
'r'
:
case
'R'
:
extChar
=
path
.
charAt
(
index
--);
switch
(
extChar
)
{
case
'a'
:
case
'A'
:
extChar
=
path
.
charAt
(
index
--);
switch
(
extChar
)
{
case
'j'
:
case
'J'
:
if
(
path
.
charAt
(
index
)
==
'.'
)
{
return
true
;
}
break
;
case
'e'
:
case
'E'
:
if
(
path
.
charAt
(
index
)
==
'.'
)
{
return
true
;
}
break
;
}
}
break
;
}
return
false
;
}
/**
* Answers the extension of the given path. An extension is normally a three
* character addition to the end of a filename separated from the filename
by
*
the '.' character.
*
* @param path
*
a file path, not <code>null</code>
* @return String the extension of the path
*/
* Answers the extension of the given path. An extension is normally a three
* character addition to the end of a filename separated from the filename
* by
the '.' character.
*
* @param path
*
a file path, not <code>null</code>
* @return String the extension of the path
*/
public
static
String
getExtension
(
String
path
)
{
int
index
=
path
.
lastIndexOf
(
'.'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment