/*
 * Copyright 2017 the original author or authors.
 *
 * Licensed 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.gradle.internal.file;

/**
 * An immutable snapshot of the metadata of a file.
 */
public interface FileMetadataSnapshot {
    FileType getType();

    /**
     * Note: always 0 for directories and missing files.
     */
    long getLastModified();

    /**
     * Note: always 0 for directories and missing files.
     */
    long getLength();

    /**
     * How the file with the metadata was accessed.
     */
    AccessType getAccessType();

    /**
     * How the file with the metadata was accessed.
     */
    enum AccessType {
        /**
         * The path pointed to the file directly.
         */
        DIRECT,

        /**
         * The path pointed to a symlink pointing to the file with the metadata.
         */
        VIA_SYMLINK
    }
}

@@ -1121,32 +1121,666 @@
 a was accessed.%0A
+     *%0A     * If we have a symlink situation like %60symlink1%60 -%3E %60symlink2%60 -%3E %60target%60,%0A     * then the metadata snapshot for %60symlink1%60 will have an access type %7B@link AccessType#VIA_SYMLINK%7D%0A     * and the metadata of %60target%60, i.e. the accessor will resolve transitive symlinks.%0A     *%0A     * If the directory %60symlinkedDir%60 -%3E %60targetDir%60 is a symlink, then the%0A     * metadata snapshot of %60symlinkedDir/fileInDir%60 will be %7B@link AccessType#DIRECT%7D,%0A     * given the file %60targetDir/fileInDir%60 exists. That means that %7B@link AccessType%7D%0A     * only gives information about the queried path, not about parents of the queried path.%0A
      */%0A    enum

Add more Javadoc on `AccessType`