Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Genesys Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Backend
Commits
3a95717f
Commit
3a95717f
authored
Sep 24, 2017
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Genesys FTP
parent
dbff36cf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
4 deletions
+19
-4
src/main/java/org/genesys2/server/service/impl/InstituteFilesServiceImpl.java
...nesys2/server/service/impl/InstituteFilesServiceImpl.java
+2
-2
src/main/java/org/genesys2/server/servlet/controller/admin/RepositoryController.java
...server/servlet/controller/admin/RepositoryController.java
+2
-2
src/main/java/org/genesys2/spring/config/FileRepositoryConfig.java
...java/org/genesys2/spring/config/FileRepositoryConfig.java
+7
-0
src/main/resources/liquibase/liquibase-changeLog.yml
src/main/resources/liquibase/liquibase-changeLog.yml
+8
-0
No files found.
src/main/java/org/genesys2/server/service/impl/InstituteFilesServiceImpl.java
View file @
3a95717f
...
...
@@ -60,11 +60,11 @@ public class InstituteFilesServiceImpl implements InstituteFilesService {
private
ImageGalleryService
imageGalleryService
;
private
static
final
String
getGalleriesPrefix
(
final
FaoInstitute
institute
)
{
return
REPOSITORY_GALLERIES_PREFIX
+
institute
.
getCode
()
+
"/acn
/
"
;
return
REPOSITORY_GALLERIES_PREFIX
+
institute
.
getCode
()
+
"/acn"
;
}
private
static
final
String
getGalleryPath
(
final
FaoInstitute
institute
,
final
Accession
accession
)
{
return
getGalleriesPrefix
(
institute
)
+
accession
.
getAccessionName
()
+
"/"
;
return
getGalleriesPrefix
(
institute
)
+
"/"
+
accession
.
getAccessionName
()
;
}
@Override
...
...
src/main/java/org/genesys2/server/servlet/controller/admin/RepositoryController.java
View file @
3a95717f
...
...
@@ -66,7 +66,7 @@ public class RepositoryController extends BaseController {
private
ImageGalleryService
imageGalleryService
;
@RequestMapping
(
value
=
"/files/**"
,
method
=
RequestMethod
.
GET
)
public
String
listAllFiles
(
HttpServletRequest
request
,
ModelMap
model
)
throws
UnsupportedEncodingException
{
public
String
listAllFiles
(
HttpServletRequest
request
,
ModelMap
model
)
throws
UnsupportedEncodingException
,
InvalidRepositoryPathException
{
String
fullpath
=
(
String
)
request
.
getAttribute
(
HandlerMapping
.
PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE
);
fullpath
=
fullpath
.
substring
(
CONTROLLER_PATH
.
length
()
+
"/files"
.
length
());
...
...
@@ -77,7 +77,7 @@ public class RepositoryController extends BaseController {
}
@RequestMapping
(
value
=
"/files"
,
method
=
RequestMethod
.
GET
)
public
String
listAllFiles
(
@RequestParam
(
defaultValue
=
"/"
)
String
repositoryPath
,
ModelMap
model
)
{
public
String
listAllFiles
(
@RequestParam
(
defaultValue
=
"/"
)
String
repositoryPath
,
ModelMap
model
)
throws
InvalidRepositoryPathException
{
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"Listing files for path="
+
repositoryPath
);
}
...
...
src/main/java/org/genesys2/spring/config/FileRepositoryConfig.java
View file @
3a95717f
...
...
@@ -32,6 +32,7 @@ import org.apache.ftpserver.usermanager.UsernamePasswordAuthentication;
import
org.apache.ftpserver.usermanager.impl.AbstractUserManager
;
import
org.apache.ftpserver.usermanager.impl.ConcurrentLoginPermission
;
import
org.apache.ftpserver.usermanager.impl.WritePermission
;
import
org.genesys.blocks.security.lockout.AccountLockoutManager
;
import
org.genesys.filerepository.service.BytesStorageService
;
import
org.genesys.filerepository.service.ImageGalleryService
;
import
org.genesys.filerepository.service.RepositoryService
;
...
...
@@ -179,6 +180,9 @@ public class FileRepositoryConfig implements InitializingBean {
@Bean
public
UserManager
ftpUserManager
()
{
return
new
AbstractUserManager
()
{
@Autowired
private
AccountLockoutManager
lockoutManager
;
private
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
...
...
@@ -238,8 +242,11 @@ public class FileRepositoryConfig implements InitializingBean {
if
(!
userService
.
checkPasswordsMatch
(
password
,
user
.
getFtpPassword
()))
{
// password mismatch
lockoutManager
.
handleFailedLogin
(
username
);
throw
new
AuthenticationFailedException
(
"Authentication failed"
);
}
else
{
lockoutManager
.
handleSuccessfulLogin
(
username
);
LOG
.
info
(
"FTP login successful for {}"
,
username
);
try
{
return
getUserByName
(
username
);
}
catch
(
FtpException
e
)
{
...
...
src/main/resources/liquibase/liquibase-changeLog.yml
View file @
3a95717f
...
...
@@ -445,3 +445,11 @@ databaseChangeLog:
-
dropColumn
:
tableName
:
repositoryimage
columnName
:
createdBy
-
changeSet
:
id
:
1506155384557-5
author
:
mobreza (generated)
changes
:
-
addAutoIncrement
:
tableName
:
repositorygallery
columnName
:
id
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment