Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor 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
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
f04968b2
Commit
f04968b2
authored
6 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-3918: check the real filename in VFS web service too
parent
d0ad479c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/olat/core/util/vfs/restapi/VFSWebservice.java
+1
-1
1 addition, 1 deletion
...in/java/org/olat/core/util/vfs/restapi/VFSWebservice.java
src/test/java/org/olat/restapi/FolderTest.java
+28
-5
28 additions, 5 deletions
src/test/java/org/olat/restapi/FolderTest.java
with
29 additions
and
6 deletions
src/main/java/org/olat/core/util/vfs/restapi/VFSWebservice.java
+
1
−
1
View file @
f04968b2
...
...
@@ -525,7 +525,7 @@ public class VFSWebservice {
for
(
PathSegment
seg:
path
)
{
String
segPath
=
seg
.
getPath
();
for
(
VFSItem
item
:
directory
.
getItems
(
new
SystemItemFilter
()))
{
if
(
normalize
(
item
.
getName
()).
equals
(
segPath
))
{
if
(
item
.
getName
().
equals
(
segPath
)
||
normalize
(
item
.
getName
()).
equals
(
segPath
))
{
if
(
item
instanceof
VFSLeaf
)
{
if
(
path
.
get
(
path
.
size
()
-
1
)
==
seg
)
{
resolvedItem
=
item
;
...
...
This diff is collapsed.
Click to expand it.
src/test/java/org/olat/restapi/FolderTest.java
+
28
−
5
View file @
f04968b2
...
...
@@ -20,9 +20,15 @@
package
org.olat.restapi
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
olat
.
core
.
util
.
vfs
.
restapi
.
VFSWebservice
.
normalize
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runners.Parameterized
;
import
org.junit.runners.Parameterized.Parameters
;
import
org.olat.core.util.vfs.restapi.VFSWebservice
;
/**
*
* <h3>Description:</h3>
...
...
@@ -30,13 +36,30 @@ import org.junit.Test;
* Initial Date: 28 jan. 2011 <br>
* @author srosse, stephane.rosse@frentix.com, www.frentix.com
*/
@RunWith
(
Parameterized
.
class
)
public
class
FolderTest
{
@Parameters
public
static
Collection
<
Object
[]>
data
()
{
return
Arrays
.
asList
(
new
Object
[][]
{
{
"HASTDJUR"
,
"HÄSTDJUR"
},
{
"HASTDJUR"
,
"HÄSTDJÜR"
},
{
"HAST_DJUR"
,
"HÄST_DJUR"
},
{
"This_is_a_funky_String"
,
"Tĥïŝ ĩš â fůňķŷ Šťŕĭńġ"
}
});
}
private
String
expected
;
private
String
string
;
public
FolderTest
(
String
expected
,
String
string
)
{
this
.
expected
=
expected
;
this
.
string
=
string
;
}
@Test
public
void
testNormalizer
()
{
assertEquals
(
"HASTDJUR"
,
normalize
(
"HÄSTDJUR"
));
assertEquals
(
"HASTDJUR"
,
normalize
(
"HÄSTDJÜR"
));
assertEquals
(
"HAST_DJUR"
,
normalize
(
"HÄST_DJUR"
));
assertEquals
(
"This_is_a_funky_String"
,
normalize
(
"Tĥïŝ ĩš â fůňķŷ Šťŕĭńġ"
));
String
normalized
=
VFSWebservice
.
normalize
(
string
);
assertEquals
(
expected
,
normalized
);
}
}
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