/*
 * 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
    }
}

/*
 * 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
    }
}

Add newline between enum constants.
Add newline between enum constants.

Co-authored-by: Lóránt Pintér <af37ce1066612ac119d4d429b57f5a7aabf0bdac@gradle.com>