@Test public void testFileSystemCreate() throws Exception { BlockDeviceDriver blockDevice = new FileBlockDeviceDriver( new URL("https: 2 * 512); blockDevice.init(); PartitionTable table = PartitionTableFactory.createPartitionTable(blockDevice); assertTrue(table instanceof FileSystemPartitionTable); }
public static PartitionTable createPartitionTable(BlockDeviceDriver blockDevice) throws IOException { for(PartitionTableCreator creator : partitionTables) { PartitionTable table = creator.read(blockDevice); if(table != null) { return table; } } throw new UnsupportedPartitionTableException(); }
PartitionTableFactory { public static PartitionTable createPartitionTable(BlockDeviceDriver blockDevice) throws IOException { for(PartitionTableCreator creator : partitionTables) { PartitionTable table = creator.read(blockDevice); if(table != null) { return table; } } throw new UnsupportedPartitionTableException(); } }
PartitionTableFactory { public static PartitionTable createPartitionTable(BlockDeviceDriver blockDevice) throws IOException { for(PartitionTableCreator creator : partitionTables) { PartitionTable table = creator.read(blockDevice); if(table != null) { return table; } } throw new UnsupportedPartitionTableException(); }  }
PartitionTableFactory { public static PartitionTable createPartitionTable(BlockDeviceDriver blockDevice) throws IOException { for(PartitionTableCreator creator : partitionTables) { PartitionTable table = creator.read(blockDevice); if(table != null) { return table; } } throw new UnsupportedPartitionTableException(); }  static PartitionTable createPartitionTable(BlockDeviceDriver blockDevice); static synchronized void registerPartitionTable(PartitionTableCreator creator); }
PartitionTableFactory { public static PartitionTable createPartitionTable(BlockDeviceDriver blockDevice) throws IOException { for(PartitionTableCreator creator : partitionTables) { PartitionTable table = creator.read(blockDevice); if(table != null) { return table; } } throw new UnsupportedPartitionTableException(); }  static PartitionTable createPartitionTable(BlockDeviceDriver blockDevice); static synchronized void registerPartitionTable(PartitionTableCreator creator);  }