Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Max Mecklin
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 41df4ee4
authored
Sep 06, 2014
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Glassfish 4.1 changes behaviour of getRealPath() so that it requires the file to exist.
1 parent
296f1b73
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/UserBean.java
code/MoyaWeb/WebContent/dydata/userimage/DO_NOT_DELETE
code/MoyaWeb/src/fi/codecrew/moya/servlet/FileDownloadServlet.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/UserBean.java
View file @
41df4ee
...
...
@@ -264,7 +264,7 @@ public class UserBean implements UserBeanLocal {
@RolesAllowed
(
SpecialPermission
.
S_USER
)
public
UserImage
uploadImage
(
EventUser
user
,
String
contentType
,
InputStream
imagestream
,
String
filename
,
String
description
)
{
user
=
eventUserFacade
.
merge
(
user
);
user
=
eventUserFacade
.
reload
(
user
);
logger
.
debug
(
"uploading image to userid {}"
,
user
);
EventUser
curruser
=
permbean
.
getCurrentUser
();
...
...
code/MoyaWeb/WebContent/dydata/userimage/DO_NOT_DELETE
0 → 100644
View file @
41df4ee
File mode changed
code/MoyaWeb/src/fi/codecrew/moya/servlet/FileDownloadServlet.java
View file @
41df4ee
...
...
@@ -111,9 +111,13 @@ public class FileDownloadServlet extends GenericImageServlet {
// Create image on file for cropper to work...
// Check
// http://code.google.com/p/primefaces/issues/detail?id=3751
String
imagefilePath
=
this
.
getServletContext
().
getRealPath
(
"/dydata/"
+
super
.
request
.
getPathInfo
());
File
imagefile
=
new
File
(
imagefilePath
);
if
(!
imagefile
.
exists
())
String
dydataRoot
=
this
.
getServletContext
().
getRealPath
(
"/dydata/"
);
File
imagefile
=
null
;
if
(
dydataRoot
!=
null
)
{
imagefile
=
new
File
(
dydataRoot
+
super
.
request
.
getPathInfo
());
}
if
(
imagefile
!=
null
&&
!
imagefile
.
exists
())
{
File
parentPath
=
new
File
(
imagefile
.
getParent
());
if
(!
parentPath
.
isDirectory
()
&&
!
parentPath
.
mkdirs
())
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment