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
4ff28e04
Commit
4ff28e04
authored
16 years ago
by
david_williams
Browse files
Options
Downloads
Patches
Plain Diff
check for no zip file
parent
60581394
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
plugins/org.eclipse.wtp.releng.tools/src/org/eclipse/wtp/releng/tools/UpdatePackPropertiesFile.java
+40
-33
40 additions, 33 deletions
...rg/eclipse/wtp/releng/tools/UpdatePackPropertiesFile.java
with
40 additions
and
33 deletions
plugins/org.eclipse.wtp.releng.tools/src/org/eclipse/wtp/releng/tools/UpdatePackPropertiesFile.java
+
40
−
33
View file @
4ff28e04
...
...
@@ -286,51 +286,58 @@ public class UpdatePackPropertiesFile extends Task {
byte
[]
buf
=
new
byte
[
1024
];
ZipInputStream
zipinputstream
=
null
;
ZipEntry
zipentry
;
zipinputstream
=
new
ZipInputStream
(
new
FileInputStream
(
zipfilename
));
// make sure destination exists
File
dir
=
new
File
(
destinationdirectory
);
boolean
success
=
dir
.
mkdirs
();
if
(
success
)
{
File
testFile
=
new
File
(
zipfilename
);
if
(!
testFile
.
exists
())
{
log
(
"Zip file, "
+
zipfilename
+
", does not exist."
);
}
else
{
zipinputstream
=
new
ZipInputStream
(
new
FileInputStream
(
zipfilename
));
// make sure destination exists
File
dir
=
new
File
(
destinationdirectory
);
boolean
success
=
dir
.
mkdirs
();
if
(
success
)
{
zipentry
=
zipinputstream
.
getNextEntry
();
while
(
zipentry
!=
null
)
{
// for each entry to be extracted
String
entryName
=
zipentry
.
getName
();
log
(
"entryname: "
+
entryName
,
Project
.
MSG_DEBUG
);
int
n
;
FileOutputStream
fileoutputstream
;
zipentry
=
zipinputstream
.
getNextEntry
();
while
(
zipentry
!=
null
)
{
// for each entry to be extracted
String
entryName
=
zipentry
.
getName
();
log
(
"entryname: "
+
entryName
,
Project
.
MSG_DEBUG
);
int
n
;
FileOutputStream
fileoutputstream
;
String
fullname
=
destinationdirectory
+
entryName
;
if
(
zipentry
.
isDirectory
())
{
// we assume folder entries come before their files.
// not sure that's always true?
File
newDir
=
new
File
(
fullname
);
newDir
.
mkdirs
();
}
else
{
File
newFile
=
new
File
(
fullname
);
fileoutputstream
=
new
FileOutputStream
(
newFile
);
String
fullname
=
destinationdirectory
+
entryName
;
if
(
zipentry
.
isDirectory
())
{
// we assume folder entries come before their files.
// not sure that's always true?
File
newDir
=
new
File
(
fullname
);
newDir
.
mkdirs
();
}
else
{
File
newFile
=
new
File
(
fullname
);
while
((
n
=
zipinputstream
.
read
(
buf
,
0
,
1024
))
>
-
1
)
fileoutputstream
.
write
(
buf
,
0
,
n
);
fileoutputstream
.
close
();
}
fileoutputstream
=
new
FileOutputStream
(
newFile
);
zipinputstream
.
closeEntry
();
zipentry
=
zipinputstream
.
getNextEntry
();
while
((
n
=
zipinputstream
.
read
(
buf
,
0
,
1024
))
>
-
1
)
fileoutputstream
.
write
(
buf
,
0
,
n
);
fileoutputstream
.
close
();
}
}
// while
zipinputstream
.
closeEntry
();
zipentry
=
zipinputstream
.
getNextEntry
();
zipinputstream
.
close
();
}
}
// while
else
{
throw
new
BuildException
(
"Could not create directory: "
+
destinationdirectory
);
zipinputstream
.
close
();
}
else
{
throw
new
BuildException
(
"Could not create directory: "
+
destinationdirectory
);
}
}
}
...
...
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