当前位置: 首页>>代码示例>>Java>>正文


Java FileEntry.isDirectory方法代码示例

本文整理汇总了Java中com.android.ddmlib.FileListingService.FileEntry.isDirectory方法的典型用法代码示例。如果您正苦于以下问题:Java FileEntry.isDirectory方法的具体用法?Java FileEntry.isDirectory怎么用?Java FileEntry.isDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.android.ddmlib.FileListingService.FileEntry的用法示例。


在下文中一共展示了FileEntry.isDirectory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: push

import com.android.ddmlib.FileListingService.FileEntry; //导入方法依赖的package包/类
/**
 * Push several files.
 * @param local An array of loca files to push
 * @param remote the remote {@link FileEntry} representing a directory.
 * @param monitor The progress monitor. Cannot be null.
 * @throws SyncException if file could not be pushed
 * @throws IOException in case of I/O error on the connection.
 * @throws TimeoutException in case of a timeout reading responses from the device.
 */
public void push(String[] local, FileEntry remote, ISyncProgressMonitor monitor)
        throws SyncException, IOException, TimeoutException {
    if (!remote.isDirectory()) {
        throw new SyncException(SyncError.REMOTE_IS_FILE);
    }

    // make a list of File from the list of String
    ArrayList<File> files = new ArrayList<File>();
    for (String path : local) {
        files.add(new File(path));
    }

    // get the total count of the bytes to transfer
    File[] fileArray = files.toArray(new File[files.size()]);
    int total = getTotalLocalFileSize(fileArray);

    monitor.start(total);

    doPush(fileArray, remote.getFullPath(), monitor);

    monitor.stop();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:SyncService.java

示例2: push

import com.android.ddmlib.FileListingService.FileEntry; //导入方法依赖的package包/类
/**
 * Push several files.
 * @param local An array of loca files to push
 * @param remote the remote {@link FileEntry} representing a directory.
 * @param monitor The progress monitor. Cannot be null.
 * @throws SyncException if file could not be pushed
 * @throws IOException in case of I/O error on the connection.
 * @throws TimeoutException in case of a timeout reading responses from the device.
 */
public void push(String[] local, FileEntry remote, ISyncProgressMonitor monitor)
        throws SyncException, IOException, TimeoutException {
    if (remote.isDirectory() == false) {
        throw new SyncException(SyncError.REMOTE_IS_FILE);
    }

    // make a list of File from the list of String
    ArrayList<File> files = new ArrayList<File>();
    for (String path : local) {
        files.add(new File(path));
    }

    // get the total count of the bytes to transfer
    File[] fileArray = files.toArray(new File[files.size()]);
    int total = getTotalLocalFileSize(fileArray);

    monitor.start(total);

    doPush(fileArray, remote.getFullPath(), monitor);

    monitor.stop();
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:32,代码来源:SyncService.java

示例3: updateFiler

import com.android.ddmlib.FileListingService.FileEntry; //导入方法依赖的package包/类
private void updateFiler() {
    FileEntry[] entries = mFileSvr.getChildren(mCurEntry, true, null);

    mListModel.clear();
    ((DefaultTableModel) mCurDirFilesModel).getDataVector().clear();

    mListModel.addElement(mCurEntry.getParent());

    for (FileEntry fileEntry : entries) {
        Object[] details = new Object[7];

        if (fileEntry.isDirectory()) {
            mListModel.addElement(fileEntry);
            details[0] = mIconFolder;
        } else {
            details[0] = mIconFile;
        }

        details[1] = fileEntry.getName();
        details[2] = fileEntry.getSize();
        details[3] = fileEntry.getDate();
        details[4] = fileEntry.getTime();
        details[5] = fileEntry.getPermissions();
        details[6] = fileEntry.getInfo();
        mCurDirFilesModel.addRow(details);

        // System.out.println(details[1]);
    }
}
 
开发者ID:HoneyFish,项目名称:SmartTools,代码行数:30,代码来源:PageFiler.java

示例4: pushIntoSelection

import com.android.ddmlib.FileListingService.FileEntry; //导入方法依赖的package包/类
/**
 * Push new file(s) and folder(s) into the current selection. Current
 * selection must be single item. If the current selection is not a
 * directory, the parent directory is used.
 * This method displays a dialog to let the user choose file to push to
 * the device.
 */
public void pushIntoSelection() {
    // get the name of the object we're going to pull
    TreeItem[] items = mTree.getSelection();

    if (items.length == 0) {
        return;
    }

    FileDialog dlg = new FileDialog(mParent.getShell(), SWT.OPEN);
    String fileName;

    dlg.setText("Put File on Device");

    // There should be only one.
    FileEntry entry = (FileEntry)items[0].getData();
    dlg.setFileName(entry.getName());

    String defaultPath = mDefaultSave;
    if (defaultPath == null) {
        defaultPath = System.getProperty("user.home"); //$NON-NLS-1$
    }
    dlg.setFilterPath(defaultPath);

    fileName = dlg.open();
    if (fileName != null) {
        mDefaultSave = dlg.getFilterPath();

        // we need to figure out the remote path based on the current selection type.
        String remotePath;
        FileEntry toRefresh = entry;
        if (entry.isDirectory()) {
            remotePath = entry.getFullPath();
        } else {
            toRefresh = entry.getParent();
            remotePath = toRefresh.getFullPath();
        }

        pushFile(fileName, remotePath);
        mTreeViewer.refresh(toRefresh);
    }
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:49,代码来源:DeviceExplorer.java


注:本文中的com.android.ddmlib.FileListingService.FileEntry.isDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。