Claudenw commented on code in PR #311: URL: https://github.com/apache/creadur-rat/pull/311#discussion_r1805066558
########## apache-rat-core/src/main/java/org/apache/rat/document/impl/DocumentName.java: ########## @@ -0,0 +1,220 @@ +/* + * 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.rat.document.impl; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.StringUtils; + + +/** + * A collection of names for a document. All names in the set are + * either Rat (Linux like) or Native (OS specific). + */ +public final class DocumentName implements Comparable<DocumentName> { + /** True if the file system on which we are operating is case-sensitive */ + public static final boolean FS_IS_CASE_SENSITIVE; + /** The full name for the document */ + private final String name; + /** The name of the base directory for the document */ + private final String baseName; + /** The directory separator for this document. */ + private final String dirSeparator; + /** The case-sensitive flag */ + private final boolean isCaseSensitive; + + static { + boolean fsSensitive = true; + try { + Path p = Files.createTempDirectory("NameSet"); Review Comment: good catch, A added a finally block to the try. -- 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: dev-unsubscr...@creadur.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org