~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to subversion/bindings/javahl/src/org/apache/subversion/javahl/types/Status.java

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2015-08-07 21:32:47 UTC
  • mfrom: (0.2.15) (4.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20150807213247-ozyewtmgsr6tkewl
Tags: 1.9.0-1
* Upload to unstable
* New upstream release.
  + Security fixes
    - CVE-2015-3184: Mixed anonymous/authenticated path-based authz with
      httpd 2.4
    - CVE-2015-3187: svn_repos_trace_node_locations() reveals paths hidden
      by authz
* Add >= 2.7 requirement for python-all-dev Build-Depends, needed to run
  tests.
* Remove Build-Conflicts against ruby-test-unit.  (Closes: #791844)
* Remove patches/apache_module_dependency in favor of expressing the
  dependencies in authz_svn.load/dav_svn.load.
* Build-Depend on apache2-dev (>= 2.4.16) to ensure ap_some_authn_required()
  is available when building mod_authz_svn and Depend on apache2-bin (>=
  2.4.16) for runtime support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 */
36
36
public class Status implements java.io.Serializable
37
37
{
38
 
    // Update the serialVersionUID when there is a incompatible change
39
 
    // made to this class.  See any of the following, depending upon
40
 
    // the Java release.
41
 
    // http://java.sun.com/j2se/1.3/docs/guide/serialization/spec/version.doc7.html
42
 
    // http://java.sun.com/j2se/1.4/pdf/serial-spec.pdf
43
 
    // http://java.sun.com/j2se/1.5.0/docs/guide/serialization/spec/version.html#6678
44
 
    // http://java.sun.com/javase/6/docs/platform/serialization/spec/version.html#6678
45
 
    private static final long serialVersionUID = 2L;
 
38
    // Update the serialVersionUID when there is a incompatible change made to
 
39
    // this class.  See the java documentation for when a change is incompatible.
 
40
    // http://java.sun.com/javase/7/docs/platform/serialization/spec/version.html#6678
 
41
    private static final long serialVersionUID = 3L;
46
42
 
47
43
    /**
48
44
     * the url for accessing the item
81
77
    private String lastCommitAuthor;
82
78
 
83
79
    /**
84
 
     * the file or directory status (See StatusKind)
 
80
     * The status of the node, based on restructuring changes; if the node
 
81
     * has no restructuring changes, it's based on textStatus and propStatus.
 
82
     * @since 1.9
 
83
     */
 
84
    private Kind nodeStatus;
 
85
 
 
86
    /**
 
87
     * The file or directory status, not including restructuring changes.
85
88
     */
86
89
    private Kind textStatus;
87
90
 
88
91
    /**
89
 
     * the status of the properties (See StatusKind)
 
92
     * The status of the properties.
90
93
     */
91
94
    private Kind propStatus;
92
95
 
112
115
    private boolean fileExternal;
113
116
 
114
117
    /**
 
118
     * The depth of the node as recorded in the working copy.
 
119
     * @since 1.9
 
120
     */
 
121
    private Depth depth;
 
122
 
 
123
    /**
115
124
     * is this item in a conflicted state
116
125
     */
117
126
    private boolean isConflicted;
118
127
 
119
128
    /**
 
129
     * The status of the node, based on text and property status, unless the
 
130
     * node has restructuring changes.
 
131
     * @since 1.9
 
132
     */
 
133
    private Kind repositoryNodeStatus;
 
134
 
 
135
    /**
120
136
     * the file or directory status of base (See StatusKind)
121
137
     */
122
138
    private Kind repositoryTextStatus;
168
184
    private String movedFromAbspath;
169
185
 
170
186
    private String movedToAbspath;
171
 
 
172
187
    /**
173
188
     * this constructor should only called from JNI code
174
189
     * @param path                  the file system path of item
178
193
     * @param lastChangedRevision   the last revision this item was changed
179
194
     * @param lastChangedDate       the last date this item was changed
180
195
     * @param lastCommitAuthor      the author of the last change
181
 
     * @param textStatus            the file or directory status (See
182
 
     *                              StatusKind)
183
 
     * @param propStatus            the property status (See StatusKind)
184
 
     * @param repositoryTextStatus  the file or directory status of the base
 
196
     * @param nodeStatus            the status of the node
 
197
     * @param textStatus            the file or directory contents status
 
198
     * @param propStatus            the property status
 
199
     * @param repositoryNodeStatus  the status of the base node
 
200
     * @param repositoryTextStatus  the file or directory contents status of the base
185
201
     * @param repositoryPropStatus  the property status of the base
186
202
     * @param locked                if the item is locked (running or aborted
187
203
     *                              operation)
188
204
     * @param copied                if the item is copy
 
205
     * @param depth                 the inherent depth of the node in the working copy
189
206
     * @param isConflicted          if the item is part of a conflict
190
 
     * @param conflictDescriptor    the description of the tree conflict
191
 
     * @param conflictOld           in case of conflict, the file name of the
192
 
     *                              the common base version
193
 
     * @param conflictNew           in case of conflict, the file name of new
194
 
     *                              repository version
195
 
     * @param conflictWorking       in case of conflict, the file name of the
196
 
     *                              former working copy version
197
207
     * @param switched              flag if the node has been switched in the
198
208
     *                              path
199
209
     * @param fileExternal          flag if the node is a file external
209
219
     * @param changelist            the changelist the item is a member of
210
220
     * @param movedFromAbspath      path moved from
211
221
     * @param movedToAbspath        path moved from
 
222
     * @since 1.9
212
223
     */
213
224
    public Status(String path, String url, NodeKind nodeKind, long revision,
214
225
                  long lastChangedRevision, long lastChangedDate,
215
 
                  String lastCommitAuthor, Kind textStatus, Kind propStatus,
 
226
                  String lastCommitAuthor,
 
227
                  Kind nodeStatus, Kind textStatus, Kind propStatus,
 
228
                  Kind repositoryNodeStatus,
216
229
                  Kind repositoryTextStatus, Kind repositoryPropStatus,
217
 
                  boolean locked, boolean copied, boolean isConflicted,
 
230
                  boolean locked, boolean copied, Depth depth,
 
231
                  boolean isConflicted,
218
232
                  boolean switched, boolean fileExternal, Lock localLock,
219
233
                  Lock reposLock, long reposLastCmtRevision,
220
234
                  long reposLastCmtDate, NodeKind reposKind,
228
242
        this.lastChangedRevision = lastChangedRevision;
229
243
        this.lastChangedDate = lastChangedDate;
230
244
        this.lastCommitAuthor = lastCommitAuthor;
 
245
        this.nodeStatus = nodeStatus;
231
246
        this.textStatus = textStatus;
232
247
        this.propStatus = propStatus;
 
248
        this.repositoryNodeStatus = repositoryNodeStatus;
 
249
        this.repositoryTextStatus = repositoryTextStatus;
 
250
        this.repositoryPropStatus = repositoryPropStatus;
233
251
        this.locked = locked;
234
252
        this.copied = copied;
 
253
        this.depth = depth;
235
254
        this.isConflicted = isConflicted;
236
 
        this.repositoryTextStatus = repositoryTextStatus;
237
 
        this.repositoryPropStatus = repositoryPropStatus;
238
255
        this.switched = switched;
239
256
        this.fileExternal = fileExternal;
240
257
        this.localLock = localLock;
249
266
    }
250
267
 
251
268
    /**
 
269
     * this constructor should only called from JNI code
 
270
     * @param path                  the file system path of item
 
271
     * @param url                   the url of the item
 
272
     * @param nodeKind              kind of item (directory, file or unknown
 
273
     * @param revision              the revision number of the base
 
274
     * @param lastChangedRevision   the last revision this item was changed
 
275
     * @param lastChangedDate       the last date this item was changed
 
276
     * @param lastCommitAuthor      the author of the last change
 
277
     * @param textStatus            the file or directory status (See
 
278
     *                              StatusKind)
 
279
     * @param propStatus            the property status (See StatusKind)
 
280
     * @param repositoryTextStatus  the file or directory status of the base
 
281
     * @param repositoryPropStatus  the property status of the base
 
282
     * @param locked                if the item is locked (running or aborted
 
283
     *                              operation)
 
284
     * @param copied                if the item is copy
 
285
     * @param isConflicted          if the item is part of a conflict
 
286
     * @param switched              flag if the node has been switched in the
 
287
     *                              path
 
288
     * @param fileExternal          flag if the node is a file external
 
289
     * @param localLock             the current lock
 
290
     * @param reposLock             the lock as stored in the repository if
 
291
     *                              any
 
292
     * @param reposLastCmtRevision  the youngest revision, if out of date
 
293
     * @param reposLastCmtDate      the last commit date, if out of date
 
294
     * @param reposKind             the kind of the youngest revision, if
 
295
     *                              out of date
 
296
     * @param reposLastCmtAuthor    the author of the last commit, if out of
 
297
     *                              date
 
298
     * @param changelist            the changelist the item is a member of
 
299
     * @param movedFromAbspath      path moved from
 
300
     * @param movedToAbspath        path moved from
 
301
     * @deprecated
 
302
     */
 
303
    @Deprecated
 
304
    public Status(String path, String url, NodeKind nodeKind, long revision,
 
305
                  long lastChangedRevision, long lastChangedDate,
 
306
                  String lastCommitAuthor, Kind textStatus, Kind propStatus,
 
307
                  Kind repositoryTextStatus, Kind repositoryPropStatus,
 
308
                  boolean locked, boolean copied, boolean isConflicted,
 
309
                  boolean switched, boolean fileExternal, Lock localLock,
 
310
                  Lock reposLock, long reposLastCmtRevision,
 
311
                  long reposLastCmtDate, NodeKind reposKind,
 
312
                  String reposLastCmtAuthor, String changelist,
 
313
                  String movedFromAbspath, String movedToAbspath)
 
314
    {
 
315
        this(path, url, nodeKind, revision,
 
316
             lastChangedRevision, lastChangedDate, lastCommitAuthor,
 
317
             Kind.none, textStatus, propStatus,
 
318
             Kind.none, repositoryTextStatus, repositoryPropStatus,
 
319
             locked, copied, Depth.unknown, isConflicted,
 
320
             switched, fileExternal, localLock, reposLock,
 
321
             reposLastCmtRevision, reposLastCmtDate, reposKind,
 
322
             reposLastCmtAuthor, changelist,
 
323
             movedFromAbspath, movedToAbspath);
 
324
    }
 
325
 
 
326
    /**
252
327
     * Returns the file system path of the item
253
328
     * @return path of status entry
254
329
     */
305
380
    }
306
381
 
307
382
    /**
308
 
     * Returns the status of the item (See StatusKind)
 
383
     * Returns the status of the node.
 
384
     * @since 1.9
 
385
     */
 
386
    public Kind getNodeStatus()
 
387
    {
 
388
        return nodeStatus;
 
389
    }
 
390
 
 
391
    /**
 
392
     * Returns the status of the node as text.
 
393
     * @since 1.9
 
394
     */
 
395
    public String getNodeStatusDescription()
 
396
    {
 
397
        return nodeStatus.toString();
 
398
    }
 
399
 
 
400
    /**
 
401
     * Returns the real status of the item's contents.
 
402
     * @since 1.9
 
403
     */
 
404
    public Kind getRawTextStatus()
 
405
    {
 
406
        return textStatus;
 
407
    }
 
408
 
 
409
    /**
 
410
     * Returns the real status of the item's contents as a string.
 
411
     * @since 1.9
 
412
     */
 
413
    public String getRawTextStatusDescription()
 
414
    {
 
415
        return textStatus.toString();
 
416
    }
 
417
 
 
418
    /**
 
419
     * Returns the adjusted status of the item's contents, as
 
420
     * compatible with JavaHL 1.8 and older verions.
309
421
     * @return file status property enum of the "textual" component.
310
422
     */
311
423
    public Kind getTextStatus()
312
424
    {
313
 
        return textStatus;
 
425
        if (nodeStatus == Kind.modified || nodeStatus == Kind.conflicted)
 
426
            return textStatus;
 
427
        return nodeStatus;
314
428
    }
315
429
 
316
430
    /**
317
 
     * Returns the status of the item as text.
 
431
     * Returns the adjusted status of the item's contents as text.
318
432
     * @return english text
319
433
     */
320
434
    public String getTextStatusDescription()
321
435
    {
322
 
        return textStatus.toString();
 
436
        return getTextStatus().toString();
323
437
    }
324
438
 
325
439
    /**
326
 
     * Returns the status of the properties (See Status Kind)
 
440
     * Returns the status of the properties.
327
441
     * @return file status property enum of the "property" component.
328
442
     */
329
443
    public Kind getPropStatus()
341
455
    }
342
456
 
343
457
    /**
344
 
     * Returns the status of the item in the repository (See StatusKind)
 
458
     * Returns the status of the node in the repository.
 
459
     * @since 1.9
 
460
     */
 
461
    public Kind getRepositoryNodeStatus()
 
462
    {
 
463
        return repositoryNodeStatus;
 
464
    }
 
465
 
 
466
    /**
 
467
     * Returns the real status of the item's contents in the repository.
 
468
     * @since 1.9
 
469
     */
 
470
    public Kind getRawRepositoryTextStatus()
 
471
    {
 
472
        return repositoryTextStatus;
 
473
    }
 
474
 
 
475
    /**
 
476
     * Returns the adjusted status of the item's contents in the
 
477
     * repository, as compatible with JavaHL 1.8 and older verions.
345
478
     * @return file status property enum of the "textual" component in the
346
479
     * repository.
347
480
     */
348
481
    public Kind getRepositoryTextStatus()
349
482
    {
350
 
        return repositoryTextStatus;
 
483
        if (repositoryNodeStatus == Kind.modified
 
484
            || repositoryNodeStatus == Kind.conflicted)
 
485
            return repositoryTextStatus;
 
486
        return repositoryNodeStatus;
351
487
    }
352
488
 
353
489
    /**
354
 
     * Returns test status of the properties in the repository (See StatusKind)
 
490
     * Returns test status of the properties in the repository.
355
491
     * @return file status property enum of the "property" component im the
356
492
     * repository.
357
493
     */
444
580
     */
445
581
    public boolean isManaged()
446
582
    {
447
 
        Kind status = getTextStatus();
 
583
        Kind status = getNodeStatus();
448
584
        return (status != Status.Kind.unversioned &&
449
585
                status != Status.Kind.none &&
450
586
                status != Status.Kind.ignored);
456
592
     */
457
593
    public boolean hasRemote()
458
594
    {
459
 
        return (isManaged() && getTextStatus() != Status.Kind.added);
 
595
        return (isManaged() && !isAdded());
460
596
    }
461
597
 
462
598
    /**
465
601
     */
466
602
    public boolean isAdded()
467
603
    {
468
 
        return getTextStatus() == Status.Kind.added;
 
604
        return getNodeStatus() == Status.Kind.added;
469
605
    }
470
606
 
471
607
    /**
474
610
     */
475
611
    public boolean isDeleted()
476
612
    {
477
 
        return getTextStatus() == Status.Kind.deleted;
 
613
        return getNodeStatus() == Status.Kind.deleted;
478
614
    }
479
615
 
480
616
    /**
483
619
     */
484
620
    public boolean isMerged()
485
621
    {
486
 
        return getTextStatus() == Status.Kind.merged;
 
622
        return getNodeStatus() == Status.Kind.merged;
487
623
    }
488
624
 
489
625
    /**
493
629
     */
494
630
    public boolean isIgnored()
495
631
    {
496
 
        return getTextStatus() == Status.Kind.ignored;
 
632
        return getNodeStatus() == Status.Kind.ignored;
497
633
    }
498
634
 
499
635
    /**
605
741
    }
606
742
 
607
743
    /**
 
744
     * Returns the inherent depth of the node, as recorded in the working copy.
 
745
     * @since 1.9
 
746
     */
 
747
    public Depth getDepth()
 
748
    {
 
749
        return depth;
 
750
    }
 
751
 
 
752
    /**
608
753
     * Converts microseconds since the epoch to a Date object.
609
754
     *
610
755
     * @param micros Microseconds since the epoch.