You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@jena.apache.org by GitBox <gi...@apache.org> on 2022/07/27 18:13:30 UTC

[GitHub] [jena] afs opened a new pull request, #1458: Accumulated small changes

afs opened a new pull request, #1458:
URL: https://github.com/apache/jena/pull/1458

   Comment fixes, supply "toString" for TDB1 abd TDB2, one protect against bad argument.
   
   Preparing for release!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org


[GitHub] [jena] afs commented on a diff in pull request #1458: Accumulated small changes

Posted by GitBox <gi...@apache.org>.
afs commented on code in PR #1458:
URL: https://github.com/apache/jena/pull/1458#discussion_r934293844


##########
jena-base/src/main/java/org/apache/jena/atlas/lib/FileOps.java:
##########
@@ -63,12 +63,19 @@ public static void delete(File f, boolean reportExistsAfter) {
         }
     }
 
-    /** Delete all files in a directory */
+    /**
+     * Delete all files in a directory.
+     * Does nothing if the path name does not exist or is not a directory.
+     *
+     * @param dir
+     */
     public static void clearDirectory(String dir) {
         File d = new File(dir) ;
-        for ( File f : d.listFiles() ) {
-            if ( f.isFile() )
-                delete(f, false) ;
+        if ( d.isDirectory() ) {
+            for ( File f : d.listFiles() ) {
+                if ( f.isFile() )

Review Comment:
   This one only deletes files. There's a separate `clearAll` for recursive deletion.
   
   It gets used mostly in testing (so, an expected controlled environment) and limits the damage in case things aren't as expected.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org


[GitHub] [jena] ajs6f commented on a diff in pull request #1458: Accumulated small changes

Posted by GitBox <gi...@apache.org>.
ajs6f commented on code in PR #1458:
URL: https://github.com/apache/jena/pull/1458#discussion_r931401464


##########
jena-arq/src/main/java/org/apache/jena/riot/web/HttpNames.java:
##########
@@ -20,8 +20,8 @@
 
 public class HttpNames
 {
-    // Switch to org.apache.http.HttpHeaders
-    // or org.apache.jena.ext.com.google.common.net
+    // See also Guava com.google.common.net.HttpHeaders

Review Comment:
   Maybe a little weird to put a Javadoc on a field, but maybe:
   ```
   /**
   * @see org.apache.jena.ext.com.google.common.net.HttpHeaders
   ```
   ?



##########
jena-base/src/main/java/org/apache/jena/atlas/lib/FileOps.java:
##########
@@ -66,9 +66,11 @@ public static void delete(File f, boolean reportExistsAfter) {
     /** Delete all files in a directory */
     public static void clearDirectory(String dir) {
         File d = new File(dir) ;
-        for ( File f : d.listFiles() ) {
-            if ( f.isFile() )
-                delete(f, false) ;
+        if ( d.exists() && d.isDirectory() ) {

Review Comment:
   [isDirectory()](https://docs.oracle.com/javase/8/docs/api/java/io/File.html#isDirectory--) actually seems to test for existence by itself, if I read "Return: true if and only if the file denoted by this abstract pathname exists and is a directory; false otherwise" correctly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org


[GitHub] [jena] afs merged pull request #1458: Accumulated small changes

Posted by GitBox <gi...@apache.org>.
afs merged PR #1458:
URL: https://github.com/apache/jena/pull/1458


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org


[GitHub] [jena] afs commented on a diff in pull request #1458: Accumulated small changes

Posted by GitBox <gi...@apache.org>.
afs commented on code in PR #1458:
URL: https://github.com/apache/jena/pull/1458#discussion_r931477356


##########
jena-arq/src/main/java/org/apache/jena/riot/web/HttpNames.java:
##########
@@ -20,8 +20,8 @@
 
 public class HttpNames
 {
-    // Switch to org.apache.http.HttpHeaders
-    // or org.apache.jena.ext.com.google.common.net
+    // See also Guava com.google.common.net.HttpHeaders

Review Comment:
   It's really an implementation note for the class. New line spacer added.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org


[GitHub] [jena] afs commented on a diff in pull request #1458: Accumulated small changes

Posted by GitBox <gi...@apache.org>.
afs commented on code in PR #1458:
URL: https://github.com/apache/jena/pull/1458#discussion_r931489267


##########
jena-base/src/main/java/org/apache/jena/atlas/lib/FileOps.java:
##########
@@ -66,9 +66,11 @@ public static void delete(File f, boolean reportExistsAfter) {
     /** Delete all files in a directory */
     public static void clearDirectory(String dir) {
         File d = new File(dir) ;
-        for ( File f : d.listFiles() ) {
-            if ( f.isFile() )
-                delete(f, false) ;
+        if ( d.exists() && d.isDirectory() ) {

Review Comment:
   Thanks! Changed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org


[GitHub] [jena] rvesse commented on a diff in pull request #1458: Accumulated small changes

Posted by GitBox <gi...@apache.org>.
rvesse commented on code in PR #1458:
URL: https://github.com/apache/jena/pull/1458#discussion_r934275094


##########
jena-base/src/main/java/org/apache/jena/atlas/lib/FileOps.java:
##########
@@ -63,12 +63,19 @@ public static void delete(File f, boolean reportExistsAfter) {
         }
     }
 
-    /** Delete all files in a directory */
+    /**
+     * Delete all files in a directory.
+     * Does nothing if the path name does not exist or is not a directory.
+     *
+     * @param dir
+     */
     public static void clearDirectory(String dir) {
         File d = new File(dir) ;
-        for ( File f : d.listFiles() ) {
-            if ( f.isFile() )
-                delete(f, false) ;
+        if ( d.isDirectory() ) {
+            for ( File f : d.listFiles() ) {
+                if ( f.isFile() )

Review Comment:
   I take it this never needs to recurse into further levels of directory?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org