Use the isOutput helper in various RemoteActionFileSystem methods.

PiperOrigin-RevId: 514968339
Change-Id: I8417a28fc0e64f75074bec83515c7af84890863b
diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteActionFileSystem.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteActionFileSystem.java
index 28ee9ba..72fb436 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/RemoteActionFileSystem.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteActionFileSystem.java
@@ -231,7 +231,7 @@
   @Override
   protected boolean delete(PathFragment path) throws IOException {
     boolean deleted = super.delete(path);
-    if (path.startsWith(outputBase)) {
+    if (isOutput(path)) {
       deleted = remoteOutputTree.getPath(path).delete() || deleted;
     }
     return deleted;
@@ -391,7 +391,7 @@
   protected void createSymbolicLink(PathFragment linkPath, PathFragment targetFragment)
       throws IOException {
     super.createSymbolicLink(linkPath, targetFragment);
-    if (linkPath.startsWith(outputBase)) {
+    if (isOutput(linkPath)) {
       remoteOutputTree.getPath(linkPath).createSymbolicLink(targetFragment);
     }
   }
@@ -567,7 +567,7 @@
 
   @Nullable
   private TreeArtifactValue getRemoteTreeMetadata(PathFragment path) {
-    if (!path.startsWith(outputBase)) {
+    if (!isOutput(path)) {
       return null;
     }
     PathFragment execPath = path.relativeTo(execRoot);
@@ -627,7 +627,7 @@
   @Override
   public void createDirectoryAndParents(PathFragment path) throws IOException {
     super.createDirectoryAndParents(path);
-    if (path.startsWith(outputBase)) {
+    if (isOutput(path)) {
       remoteOutputTree.createDirectoryAndParents(path);
     }
   }
@@ -636,7 +636,7 @@
   @Override
   public boolean createDirectory(PathFragment path) throws IOException {
     boolean created = delegateFs.createDirectory(path);
-    if (path.startsWith(outputBase)) {
+    if (isOutput(path)) {
       created = remoteOutputTree.createDirectory(path) || created;
     }
     return created;