jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zack Shoylev <notificati...@github.com>
Subject Re: [jclouds/jclouds] Ensure that jclouds filesystem provider consistently uses / (#1024)
Date Mon, 24 Oct 2016 20:41:56 GMT
zack-shoylev commented on this pull request.



>      * @return
     */
-   private static String normalize(String pathToBeNormalized) {
-      if (null != pathToBeNormalized && pathToBeNormalized.contains(BACK_SLASH))
{
-         if (!BACK_SLASH.equals(File.separator)) {
-            return pathToBeNormalized.replace(BACK_SLASH, File.separator);
-         }
+   private static String normalize(String path) {
+      if (null != path) {

I think it is better to treat both \ and / as path separators everywhere. This way people
won't be getting unexpected results and they also won't have to write different code for Windows
and Linux, which is what they would have to do if we treat \ differently. Keeps our code simpler,
too. Thoughts, counterexamples?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1024
Mime
View raw message