LamiumAmplexicaule commented on code in PR #8259: URL: https://github.com/apache/hadoop/pull/8259#discussion_r3347323630
########## hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/find/Perm.java: ########## @@ -0,0 +1,209 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.fs.shell.find; + +import java.io.IOException; +import java.util.Deque; + +import org.apache.hadoop.fs.permission.FsPermission; +import org.apache.hadoop.fs.shell.PathData; + +/** + * Implements the -perm expression for the {@link org.apache.hadoop.fs.shell.find.Find} command. + */ +final class Perm extends BaseExpression { + /** + * Registers this expression with the specified factory. + */ + public static void registerExpression(ExpressionFactory factory) throws IOException { + factory.addClass(Perm.class, "-perm"); + } + + private static final String[] USAGE = {"-perm [-]mode", "-perm [-]onum"}; + private static final String[] HELP = {"Evaluates as true if the file permissions match that", + "specified. If the hyphen is specified then the expression", + "shall evaluate as true if at least the bits specified", + "match, otherwise an exact match is required.", + "The mode may be specified using either symbolic notation,", + "eg 'u=rwx,g+x+w' or as an octal number."}; Review Comment: It wasn’t implemented in a way that would pass, so I fixed the parsing part to allow `g+x+w` in https://github.com/apache/hadoop/pull/8259/changes/9d86bfe39a675a48152ba2249f12723578d56506. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
