1 package com
.intellij
.localvcs
;
3 import java
.io
.DataInputStream
;
4 import java
.io
.DataOutputStream
;
5 import java
.io
.IOException
;
7 public class CreateFileChange
extends Change
{
9 private String myContent
;
11 public CreateFileChange(Path path
, String content
) {
16 public CreateFileChange(DataInputStream s
) throws IOException
{
18 myContent
= s
.readUTF();
22 public void write(DataOutputStream s
) throws IOException
{
25 s
.writeUTF(myContent
);
28 public Path
getPath() {
32 public String
getContent() {
37 public void applyTo(Snapshot snapshot
) {
38 snapshot
.doCreateFile(myPath
, myContent
);
42 public void revertOn(Snapshot snapshot
) {
43 snapshot
.doDelete(myPath
);