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
bbbf7412
Commit
bbbf7412
authored
16 years ago
by
david_williams
Browse files
Options
Downloads
Patches
Plain Diff
improve signing
parent
9e1c90f8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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
+30
-40
30 additions, 40 deletions
...rg/eclipse/wtp/releng/tools/UpdatePackPropertiesFile.java
with
30 additions
and
40 deletions
plugins/org.eclipse.wtp.releng.tools/src/org/eclipse/wtp/releng/tools/UpdatePackPropertiesFile.java
+
30
−
40
View file @
bbbf7412
...
...
@@ -160,7 +160,7 @@ public class UpdatePackPropertiesFile extends Task {
if
(!
success
)
{
throw
new
BuildException
(
"Could not rename original zip file to backup name."
);
}
File
newarchive
=
new
File
(
tempzipFileName
);
success
=
newarchive
.
renameTo
(
originalarchive
);
if
(!
success
)
{
...
...
@@ -233,52 +233,33 @@ public class UpdatePackPropertiesFile extends Task {
for
(
int
i
=
0
;
i
<
files
.
length
;
i
++)
{
if
(
files
[
i
].
isDirectory
())
{
String
entryName
=
files
[
i
].
getCanonicalPath
().
substring
(
rootDirectory
.
length
());
entryName
=
translate
(
entryName
,
'\\'
,
"/"
);
if
(!
entryName
.
endsWith
(
"/"
))
{
entryName
=
entryName
+
"/"
;
}
log
(
" Adding Directory Entry: "
+
entryName
,
Project
.
MSG_DEBUG
);
out
.
putNextEntry
(
new
ZipEntry
(
entryName
));
// now recurse through the directory
addDir
(
files
[
i
],
out
,
rootDirectory
);
}
else
{
FileInputStream
in
=
new
FileInputStream
(
files
[
i
].
getAbsolutePath
());
String
entryName
=
files
[
i
].
getAbsolutePath
().
substring
(
rootDirectory
.
length
());
log
(
" Adding: "
+
entryName
,
Project
.
MSG_DEBUG
);
out
.
putNextEntry
(
new
ZipEntry
(
entryName
));
// Transfer from the file to the ZIP file
int
len
;
while
((
len
=
in
.
read
(
tmpBuf
))
>
0
)
{
out
.
write
(
tmpBuf
,
0
,
len
);
String
entryName
=
files
[
i
].
getAbsolutePath
().
substring
(
rootDirectory
.
length
());
if
(!
entryName
.
equals
(
"."
)
&&
!
entryName
.
equals
(
".."
))
{
entryName
=
slashify
(
entryName
,
files
[
i
].
isDirectory
());
if
(
files
[
i
].
isDirectory
())
{
log
(
" Adding Directory Entry: "
+
entryName
);
//, Project.MSG_DEBUG);
out
.
putNextEntry
(
new
ZipEntry
(
entryName
));
// now recurse through the directory
addDir
(
files
[
i
],
out
,
rootDirectory
);
}
else
{
FileInputStream
in
=
new
FileInputStream
(
files
[
i
].
getAbsolutePath
());
log
(
" Adding: "
+
entryName
);
//, Project.MSG_DEBUG);
// Complete the entry
out
.
closeEntry
();
in
.
close
();
}
}
}
out
.
putNextEntry
(
new
ZipEntry
(
entryName
));
// Transfer from the file to the ZIP file
int
len
;
while
((
len
=
in
.
read
(
tmpBuf
))
>
0
)
{
out
.
write
(
tmpBuf
,
0
,
len
);
}
private
String
translate
(
String
entryName
,
char
c
,
String
d
)
{
String
result
=
entryName
;
if
(
entryName
.
indexOf
(
c
)
>
-
1
)
{
StringBuffer
tempHold
=
new
StringBuffer
(
entryName
);
for
(
int
i
=
0
;
i
<
tempHold
.
length
();
i
++)
{
if
(
tempHold
.
charAt
(
i
)
==
c
)
{
tempHold
.
replace
(
i
,
i
+
1
,
d
);
// Complete the entry
out
.
closeEntry
();
in
.
close
();
}
}
result
=
tempHold
.
toString
();
}
return
result
;
}
private
String
checkIfJarsSigned
(
String
currentresults
,
String
destinationDir
,
String
parentDir
,
String
[]
jars
)
throws
IOException
{
...
...
@@ -361,4 +342,13 @@ public class UpdatePackPropertiesFile extends Task {
this
.
archiveFilename
=
archiveFilename
;
}
private
String
slashify
(
String
path
,
boolean
isDirectory
)
{
String
p
=
path
;
if
(
File
.
separatorChar
!=
'/'
)
p
=
p
.
replace
(
File
.
separatorChar
,
'/'
);
if
(!
p
.
endsWith
(
"/"
)
&&
isDirectory
)
p
=
p
+
"/"
;
return
p
;
}
}
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