~veger/ganttproject/manual-import

« back to all changes in this revision

Viewing changes to ganttproject/src/net/sourceforge/ganttproject/document/FileDocument.java

  • Committer: Maarten Bezemer
  • Date: 2012-01-22 12:20:00 UTC
  • Revision ID: maarten.bezemer@gmail.com-20120122122000-qwyec45rjx86wi7o
Updated till 2fe683a778c3 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
GanttProject is an opensource project management tool. License: GPL2
 
2
GanttProject is an opensource project management tool. License: GPL3
3
3
Copyright (C) 2003-2011 GanttProject Team
4
4
 
5
5
This program is free software; you can redistribute it and/or
6
6
modify it under the terms of the GNU General Public License
7
 
as published by the Free Software Foundation; either version 2
 
7
as published by the Free Software Foundation; either version 3
8
8
of the License, or (at your option) any later version.
9
9
 
10
10
This program is distributed in the hope that it will be useful,
44
44
        this.file = file;
45
45
    }
46
46
 
 
47
    @Override
47
48
    public String getFileName() {
48
49
        return file.getName();
49
50
    }
50
51
 
 
52
    @Override
51
53
    public boolean canRead() {
52
54
        return file.canRead();
53
55
    }
54
56
 
 
57
    @Override
55
58
    public IStatus canWrite() {
56
59
        return (file.exists()) ? canOverwrite() : canCreate(file);
57
60
    }
97
100
        return canCreate(parentFile);
98
101
    }
99
102
 
 
103
    @Override
100
104
    public boolean isValidForMRU() {
101
105
        return file.exists();
102
106
    }
103
107
 
 
108
    @Override
104
109
    public InputStream getInputStream() throws FileNotFoundException {
105
110
        myLastAccessTimestamp = System.currentTimeMillis();
106
111
        return new FileInputStream(file);
107
112
    }
108
113
 
 
114
    @Override
109
115
    public OutputStream getOutputStream() throws FileNotFoundException {
110
116
        return new FileOutputStream(file) {
111
117
            @Override
116
122
        };
117
123
    }
118
124
 
 
125
    @Override
119
126
    public String getPath() {
120
127
        return file.getPath();
121
128
    }
129
136
        // Method is not used
130
137
    }
131
138
 
 
139
    @Override
132
140
    public void write() throws IOException {
133
141
        // Method is not used
134
142
    }
135
143
 
 
144
    @Override
136
145
    public URI getURI() {
137
146
        return file.toURI();
138
147
    }
139
148
 
 
149
    @Override
140
150
    public boolean isLocal() {
141
151
        return true;
142
152
    }