001/* 002 * To change this template, choose Tools | Templates 003 * and open the template in the editor. 004 */ 005package org.anarres.qemu.exec.host.disk; 006 007import java.io.File; 008 009/** 010 * 011 * @author shevek 012 */ 013public class UnixNbdDisk extends AbstractDisk { 014 015 private final File file; 016 private final String name; 017 018 public UnixNbdDisk(File file, String name) { 019 this.file = file; 020 this.name = name; 021 } 022 023 public UnixNbdDisk(String path, String name) { 024 this(new File(path), name); 025 } 026 027 @Override 028 public String toString() { 029 StringBuilder buf = new StringBuilder(); 030 buf.append("nbd:unix:").append(file.getAbsolutePath()); 031 if (name != null) 032 buf.append(":exportname=").append(name); 033 return buf.toString(); 034 } 035}