Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
d7ac76c4
Commit
d7ac76c4
authored
Jan 27, 2018
by
Graham Wallis
Committed by
Madhan Neethiraj
Jan 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2377: fix in URI parsing to address quick_start failure in Windows
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
cbfdd7fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
AtlasBaseClient.java
...ommon/src/main/java/org/apache/atlas/AtlasBaseClient.java
+22
-1
No files found.
client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
View file @
d7ac76c4
...
...
@@ -54,6 +54,7 @@ import javax.ws.rs.core.UriBuilder;
import
java.io.File
;
import
java.io.IOException
;
import
java.net.ConnectException
;
import
java.net.URI
;
import
java.nio.file.Paths
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -592,6 +593,8 @@ public abstract class AtlasBaseClient {
private
final
String
produces
;
private
final
Response
.
Status
status
;
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
API
.
class
);
public
API
(
String
path
,
String
method
,
Response
.
Status
status
)
{
this
(
path
,
method
,
status
,
JSON_MEDIA_TYPE
,
MediaType
.
APPLICATION_JSON
);
}
...
...
@@ -613,7 +616,25 @@ public abstract class AtlasBaseClient {
}
public
String
getNormalizedPath
()
{
return
Paths
.
get
(
path
).
normalize
().
toString
();
// This method used to return Paths.get(path).normalize().toString(), but
// the use of Paths.get(path) on Windows produces a path with Windows
// path separators (i.e. back-slashes) which is not valid for a URI
// and will result in an HTTP 404 status code.
URI
uri
=
null
;
String
resultUri
=
null
;
try
{
uri
=
new
URI
(
path
);
if
(
uri
!=
null
)
{
URI
normalizedUri
=
uri
.
normalize
();
resultUri
=
normalizedUri
.
toString
();
}
}
catch
(
Exception
e
)
{
LOG
.
error
(
"getNormalizedPath() caught exception for path={}"
,
path
,
e
);
resultUri
=
null
;
}
return
resultUri
;
}
public
Response
.
Status
getExpectedStatus
()
{
...
...
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