001/*
002 * (C) Copyright 2018 Nuxeo (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Florent Guillaume
018 */
019package org.nuxeo.drive.adapter.impl;
020
021import org.nuxeo.drive.adapter.FileSystemItem;
022import org.nuxeo.drive.adapter.FolderItem;
023
024/**
025 * Simple FileSystemItem just holding data, used for JSON deserialization.
026 *
027 * @since 9.10-HF01, 10.1
028 */
029public class SimpleFileSystemItem extends AbstractFileSystemItem {
030
031    protected String downloadURL;
032
033    protected String digestAlgorithm;
034
035    protected String digest;
036
037    protected boolean canUpdate;
038
039    protected boolean canCreateChild;
040
041    protected boolean canScrollDescendants;
042
043    public String getDownloadURL() {
044        return downloadURL;
045    }
046
047    public String getDigestAlgorithm() {
048        return digestAlgorithm;
049    }
050
051    public String getDigest() {
052        return digest;
053    }
054
055    public boolean getCanUpdate() {
056        return canUpdate;
057    }
058
059    public boolean getCanCreateChild() {
060        return canCreateChild;
061    }
062
063    public boolean getCanScrollDescendants() {
064        return canScrollDescendants;
065    }
066
067    public void setDownloadURL(String downloadURL) {
068        this.downloadURL = downloadURL;
069    }
070
071    public void setDigestAlgorithm(String digestAlgorithm) {
072        this.digestAlgorithm = digestAlgorithm;
073    }
074
075    public void setDigest(String digest) {
076        this.digest = digest;
077    }
078
079    public void setCanUpdate(boolean canUpdate) {
080        this.canUpdate = canUpdate;
081    }
082
083    public void setCanCreateChild(boolean canCreateChild) {
084        this.canCreateChild = canCreateChild;
085    }
086
087    public void setCanScrollDescendants(boolean canScrollDescendants) {
088        this.canScrollDescendants = canScrollDescendants;
089    }
090
091    @Override
092    public void rename(String name) {
093        throw new UnsupportedOperationException();
094    }
095
096    @Override
097    public void delete() {
098        throw new UnsupportedOperationException();
099    }
100
101    @Override
102    public boolean canMove(FolderItem dest) {
103        throw new UnsupportedOperationException();
104    }
105
106    @Override
107    public FileSystemItem move(FolderItem dest) {
108        throw new UnsupportedOperationException();
109    }
110
111    // Override equals and hashCode to explicitly show that their implementation rely on the parent class and doesn't
112    // depend on the fields added to this class.
113    @Override
114    public boolean equals(Object obj) {
115        return super.equals(obj);
116    }
117
118    @Override
119    public int hashCode() {
120        return super.hashCode();
121    }
122
123}