Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xwiki-platform
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XWiki
xwiki-platform
Commits
8b608faf
Commit
8b608faf
authored
8 months ago
by
Thomas Mortagne
Browse files
Options
Downloads
Patches
Plain Diff
XWIKI-22313: The workspace migrator is using the standard Java temporary directory
(cherry picked from commit
247d1e11
)
parent
386b3af7
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
xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-workspaces-migrator/src/main/java/org/xwiki/wiki/workspacesmigrator/internal/DefaultDocumentRestorerFromAttachedXAR.java
+5
-1
5 additions, 1 deletion
...ator/internal/DefaultDocumentRestorerFromAttachedXAR.java
with
5 additions
and
1 deletion
xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-workspaces-migrator/src/main/java/org/xwiki/wiki/workspacesmigrator/internal/DefaultDocumentRestorerFromAttachedXAR.java
+
5
−
1
View file @
8b608faf
...
...
@@ -33,6 +33,7 @@
import
org.apache.commons.io.FileUtils
;
import
org.slf4j.Logger
;
import
org.xwiki.component.annotation.Component
;
import
org.xwiki.environment.Environment
;
import
org.xwiki.model.reference.DocumentReference
;
import
com.xpn.xwiki.XWiki
;
...
...
@@ -57,6 +58,9 @@ public class DefaultDocumentRestorerFromAttachedXAR implements DocumentRestorerF
@Inject
private
Provider
<
XWikiContext
>
xcontextProvider
;
@Inject
private
Environment
environment
;
private
File
getTemporaryZipFile
(
DocumentReference
docReference
,
String
attachmentName
)
throws
XWikiException
,
IOException
{
...
...
@@ -79,7 +83,7 @@ private File getTemporaryZipFile(DocumentReference docReference, String attachme
// We need to copy the attachment to a temporary file because we want ti use ZipFile
// instead of ZipArchiveInputStream (see: http://commons.apache.org/proper/commons-compress/zip.html)
File
tempFile
=
File
.
createTempFile
(
attachmentName
,
".tmp"
);
File
tempFile
=
File
.
createTempFile
(
attachmentName
,
".tmp"
,
this
.
environment
.
getTemporaryDirectory
()
);
// We copy the content of the attachment
FileUtils
.
copyInputStreamToFile
(
xar
.
getContentInputStream
(
xcontext
),
tempFile
);
...
...
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